Part Number Hot Search : 
A3514 HCTS245K A35DB AF9013S AQW210 D8563 ST6306 MC33580
Product Description
Full Text Search
 

To Download MC68HC705P6A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  mc68hc 7 05 p 6 a /d rev 2 m 6 8 h c 0 5 m 6 0 5m68hc05 m 8 h c 0 5 m 6 8 h c mc68 h c705 p 6 a a d va n ce i n f o rma t i o n hc m o s m i c r o c o n t r o ll e r u n it
blank
MC68HC705P6A ? rev. 2.0 advance information motorola 3 MC68HC705P6A advance information motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be vali1dated for each customer application by customer?s technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola, inc. is an equal opportunity/affirmative action employer. motorola and are registered trademarks of motorola, inc. digitaldna is a trademark of motorola, inc. ? motorola, inc., 2001
advance information MC68HC705P6A ? rev. 2.0 4 motorola advance information to provide the most up-to-date information, the revision of our documents on the world wide web will be the most current. your printed copy may be an earlier revision. to verify you have the latest information available, refer to: http://www.motorola.com/semiconductors/ the following revision history table summarizes changes contained in this document. for your convenience, the page number designators have been linked to the appropriate location. revision history date revision level description page number(s) november, 2001 2.0 format update to current publication standards n/a figure 11-1. mask option register (mor) ? definition of bit 6 corrected. 92
MC68HC705P6A ? rev. 2.0 advance information motorola list of sections 5 advance information ? MC68HC705P6A list of sections section 1. general description . . . . . . . . . . . . . . . . . . . . 19 section 2. memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 section 3. operating modes . . . . . . . . . . . . . . . . . . . . . . . 35 section 4. resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 section 5. interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 section 6. input/output ports . . . . . . . . . . . . . . . . . . . . . 51 section 7. serial input/output port (siop) . . . . . . . . . . . 59 section 8. capture/compare timer . . . . . . . . . . . . . . . . . 65 section 9. analog subsystem . . . . . . . . . . . . . . . . . . . . . 77 section 10. eprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 section 11. mask option register (mor) . . . . . . . . . . . . 91 section 12. central processor unit (cpu) core . . . . . . . 95 section 13. instruction set . . . . . . . . . . . . . . . . . . . . . . . 101 section 14. electrical specifications . . . . . . . . . . . . . . . 117 section 15. mechanical specifications . . . . . . . . . . . . . 125 section 16. ordering information . . . . . . . . . . . . . . . . . 127
list of sections advance information MC68HC705P6A ? rev. 2.0 6 list of sections motorola
MC68HC705P6A ? rev. 2.0 advance information motorola table of contents 7 advance information ? MC68HC705P6A table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.4 functional pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.4.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.4.2 osc1 and osc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.4.2.1 crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.4.2.2 ceramic resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.4.2.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.4.3 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4.4 pa0 ? pa7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4.5 pb5/sdo, pb6/sdi, and pb7/sck . . . . . . . . . . . . . . . . . . .24 1.4.6 pc0-pc2, pc3/ad3, pc4/ad2, pc5/ad1, pc6/ad0, and pc7/v refh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4.7 pd5 and pd7/tcap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.4.8 tcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.4.9 irq/v pp (maskable interrupt request) . . . . . . . . . . . . . . . .25 section 2. memory 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 2.3 user mode memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 2.4 bootloader mode memory map . . . . . . . . . . . . . . . . . . . . . . . .28 2.5 input/output and control registers . . . . . . . . . . . . . . . . . . . . .29 2.6 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
table of contents advance information MC68HC705P6A ? rev. 2.0 8 table of contents motorola 2.7 eprom/rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 2.8 mask option register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.9 computer operating properly (cop) clear register . . . . . . . .34 section 3. operating modes 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3 user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.4 bootloader mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5.1 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5.1.1 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5.1.2 halt mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.5.2 wait instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 3.6 cop watchdog timer considerations . . . . . . . . . . . . . . . . . . .40 section 4. resets 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 4.3 external reset (reset ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.4.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.2 computer operating properly (cop) reset. . . . . . . . . . . . .42 section 5. interrupts 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
table of contents MC68HC705P6A ? rev. 2.0 advance information motorola table of contents 9 5.3 interrupt types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.3.1 reset interrupt sequence . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.3.2 software interrupt (swi). . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.3.3 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.3.3.1 external interrupt (irq ) . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.3.3.2 input capture interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . .49 5.3.3.3 output compare interrupt . . . . . . . . . . . . . . . . . . . . . . . .49 5.3.3.4 timer overflow interrupt . . . . . . . . . . . . . . . . . . . . . . . . .49 section 6. input/output ports 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 6.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 6.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 6.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.7 i/o port programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 section 7. serial input/output port (siop) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.3 siop signal format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.3.1 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 7.3.2 serial data input (sdi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 7.3.3 serial data output (sdo). . . . . . . . . . . . . . . . . . . . . . . . . . .61 7.4 siop registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.1 siop control register (scr) . . . . . . . . . . . . . . . . . . . . . . . .62 7.4.2 siop status register (ssr) . . . . . . . . . . . . . . . . . . . . . . . .63 7.4.3 siop data register (sdr). . . . . . . . . . . . . . . . . . . . . . . . . . 64
table of contents advance information MC68HC705P6A ? rev. 2.0 10 table of contents motorola section 8. capture/compare timer 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 8.3 timer operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 8.3.1 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 8.3.2 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 8.4 timer i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.4.1 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.4.2 timer status register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 8.4.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.4.4 alternate timer registers. . . . . . . . . . . . . . . . . . . . . . . . . . .72 8.4.5 input capture registers . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.4.6 output compare registers. . . . . . . . . . . . . . . . . . . . . . . . . .74 8.5 timer during wait/halt mode . . . . . . . . . . . . . . . . . . . . . . . . . .75 8.6 timer during stop mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 section 9. analog subsystem 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 9.3 analog section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.3.1 ratiometric conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 9.3.2 reference voltage (v refh ) . . . . . . . . . . . . . . . . . . . . . . . . . 78 9.3.3 accuracy and precision . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.4 conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.5 digital section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.5.1 conversion times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.5.2 internal versus external oscillator . . . . . . . . . . . . . . . . . . . .79 9.5.3 multi-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . . .80 9.6 a/d status and control register (adsc) . . . . . . . . . . . . . . . . . 80 9.7 a/d conversion data register (adc). . . . . . . . . . . . . . . . . . . .82 9.8 a/d subsystem operation during halt/wait modes . . . . . . . . .82 9.9 a/d subsystem operation during stop mode. . . . . . . . . . . . . .82
table of contents MC68HC705P6A ? rev. 2.0 advance information motorola table of contents 11 section 10. eprom 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 10.3 eprom erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 10.4 eprom programming sequence. . . . . . . . . . . . . . . . . . . . . . .84 10.5 eprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 10.6 eprom programming register (eprog) . . . . . . . . . . . . . . . .84 10.7 eprom bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 10.8 programming from an external memory device. . . . . . . . . . . .87 section 11. mask option register (mor) 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 11.3 mask option register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 11.4 mor programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 section 12. central processor unit (cpu) core 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 12.3 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 12.3.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 12.3.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 12.3.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 12.3.4 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 12.3.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
table of contents advance information MC68HC705P6A ? rev. 2.0 12 table of contents motorola section 13. instruction set 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 13.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 13.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 13.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 13.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.7 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 13.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 13.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 13.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .105 13.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .106 13.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .107 13.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .109 13.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 13.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 13.6 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 section 14. electrical specifications 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 14.3 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 14.4 operating temperature range. . . . . . . . . . . . . . . . . . . . . . . .118 14.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 14.6 5.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .119 14.7 3.3-volt dc electrical charactertistics . . . . . . . . . . . . . . . . . .120 14.8 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . 121
table of contents MC68HC705P6A ? rev. 2.0 advance information motorola table of contents 13 14.9 eprom programming characteristics . . . . . . . . . . . . . . . . . .122 14.10 siop timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 14.11 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 section 15. mechanical specifications 15.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 15.3 plastic dual in-line package (case 710) . . . . . . . . . . . . . . . .126 15.4 small outline integrated circuit package (case 751f) . . . . .126 section 16. ordering information 16.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 16.3 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
table of contents advance information MC68HC705P6A ? rev. 2.0 14 table of contents motorola
MC68HC705P6A ? rev. 2.0 advance information motorola list of figures 15 advance information ? MC68HC705P6A list of figures figure title page 1-1 MC68HC705P6A block diagram . . . . . . . . . . . . . . . . . . . . . . .21 1-2 oscillator connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2-1 MC68HC705P6A user mode memory map . . . . . . . . . . . . . . .28 2-2 MC68HC705P6A i/o and control registers memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 2-3 i/o and control register summary. . . . . . . . . . . . . . . . . . . . . .30 2-4 mask option register (mor) . . . . . . . . . . . . . . . . . . . . . . . . . .34 2-5 cop watchdog timer location . . . . . . . . . . . . . . . . . . . . . . . .34 3-1 user mode pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3-2 stop/wait flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 4-1 reset block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4-2 unused vector and cop watchdog timer. . . . . . . . . . . . . . . .43 5-1 interrupt processing flowchart . . . . . . . . . . . . . . . . . . . . . . . . .47 6-1 port a i/o and interrupt circuitry . . . . . . . . . . . . . . . . . . . . . . .52 6-2 port b i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6-3 port c i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 6-4 port d i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 7-1 siop block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 7-2 siop timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 7-3 siop control register (scr) . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7-4 siop status register (ssr). . . . . . . . . . . . . . . . . . . . . . . . . . .63 7-5 serial port data register (sdr) . . . . . . . . . . . . . . . . . . . . . . . .64
list of figures advance information MC68HC705P6A ? rev. 2.0 16 list of figures motorola figure title page 8-1 capture/compare timer block diagram. . . . . . . . . . . . . . . . . .66 8-2 timer control register (tcr). . . . . . . . . . . . . . . . . . . . . . . . . .68 8-3 timer status register (tsr) . . . . . . . . . . . . . . . . . . . . . . . . . .70 8-4 timer registers (trh and trl). . . . . . . . . . . . . . . . . . . . . . . .71 8-5 alternate timer registers (atrh and atrl). . . . . . . . . . . . . .72 8-6 input capture registers (icrh and icrl) . . . . . . . . . . . . . . . . 73 8-7 output compare registers (ocrh and ocrl) . . . . . . . . . . . . 74 9-1 a/d status and control register (adsc) . . . . . . . . . . . . . . . . . 80 9-2 a/d conversion value data register (adc) . . . . . . . . . . . . . . 82 10-1 eprom programming register (eprog) . . . . . . . . . . . . . . . .85 10-2 MC68HC705P6A eprom programming flowchart. . . . . . . . .89 10-3 MC68HC705P6A eprom programming schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 11-1 mask option register (mor) . . . . . . . . . . . . . . . . . . . . . . . . . .92 12-1 mc68hc05 programming model . . . . . . . . . . . . . . . . . . . . . . .96 14-1 siop timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 14-2 power-on reset and external reset timing diagram . . . . . .124
MC68HC705P6A ? rev. 2.0 advance information motorola list of tables 17 advance information ? MC68HC705P6A list of tables table title page 3-1 operating mode conditions after reset . . . . . . . . . . . . . . . . . .35 5-1 vector addresses for interrupts and reset. . . . . . . . . . . . . . . .46 6-1 port a i/o functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6-2 port b i/o functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6-3 port c i/o functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6-4 port d i/o functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 9-1 a/d multiplexer input channel assignments . . . . . . . . . . . . . .81 10-1 eprom programming routine. . . . . . . . . . . . . . . . . . . . . . . . .86 10-2 bootloader control pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 11-1 siop clock rate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 11-2 mor programming routine . . . . . . . . . . . . . . . . . . . . . . . . . . .94 13-1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . . . . .105 13-2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . . . .106 13-3 jump and branch instructions . . . . . . . . . . . . . . . . . . . . . . . .108 13-4 bit manipulation instructions. . . . . . . . . . . . . . . . . . . . . . . . . .109 13-5 control instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 13-6 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 13-7 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
list of tables advance information MC68HC705P6A ? rev. 2.0 18 list of tables motorola
MC68HC705P6A ? rev. 2.0 advance information motorola general description 19 advance information ? MC68HC705P6A section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.4 functional pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.4.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.4.2 osc1 and osc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.4.2.1 crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.4.2.2 ceramic resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.4.2.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.4.3 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4.4 pa0 ? pa7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4.5 pb5/sdo, pb6/sdi, and pb7/sck . . . . . . . . . . . . . . . . . . .24 1.4.6 pc0-pc2, pc3/ad3, pc4/ad2, pc5/ad1, pc6/ad0, and pc7/v refh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.4.7 pd5 and pd7/tcap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.4.8 tcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.4.9 irq/v pp (maskable interrupt request) . . . . . . . . . . . . . . . .25 1.2 introduction the MC68HC705P6A is an eprom version of the mc68hc05p6 microcontroller. it is a low-cost combination of an m68hc05 family microprocessor with a 4-channel, 8-bit analog-to-digital (a/d) converter, a 16-bit timer with output compare and input capture, a serial communications port (siop), and a computer operating properly (cop) watchdog timer. the m68hc05 cpu core contains 176 bytes of ram, 4672 bytes of user eprom, 239 bytes of bootloader rom, and 21 input/output (i/o) pins (20 bidirectional, 1 input-only). this device is
general description advance information MC68HC705P6A ? rev. 2.0 20 general description motorola available in either a 28-pin plastic dual in-line (pdip) or a 28-pin small outline integrated circuit (soic) package. a functional block diagram of the MC68HC705P6A is shown in figure 1-1 . 1.3 features features of the MC68HC705P6A include:  low cost  m68hc05 core  28-pin soic, pdip, or windowed dip package  4672 bytes of user eprom (including 48 bytes of page zero eprom and 16 bytes of user vectors)  239 bytes of bootloader rom  176 bytes of on-chip ram  4-channel 8-bit a/d converter  siop serial communications port  16-bit timer with output compare and input capture  20 bidirectional i/o lines and 1 input-only line  pc0 and pc1 high-current outputs  single-chip, bootloader, and test modes  power-saving stop, halt, and wait modes  static eprom mask option register (mor) selectable options: ? cop watchdog timer enable or disable ? edge-sensitive or edge- and level-sensitive external interrupt ? siop most significant bit (msb) or least significant bit (lsb) first ? siop clock rates: osc divided by 8, 16, 32, or 64 ? stop instruction mode, stop or halt ? eprom security external lockout ? programmable keyscan (pullups/interrupts) on pa0 ? pa7
general description features MC68HC705P6A ? rev. 2.0 advance information motorola general description 21 figure 1-1. MC68HC705P6A block diagram note: a line over a signal name indicates an active low signal. for example, reset is active high and reset is active low. any reference to voltage, current, or frequency specified in the following sections will refer to the nominal values. the exact values and their tolerances or limits are specified in section 14. electrical specifications . internal cpu clock a/ d converter 16-bit timer 1 input capture 1 output compare port d logic cop osc cond code reg 1 1 1 i n z c h index reg cpu control 0 0 0 stk pntr 1 1 0 0 0 0 0 4 reset osc 1 osc 2 pd7/tcap sram ? 176 bytes user eprom ? 4672 bytes tcmp irq /v pp alu m68hc05 cpu accum program counter cpu registers 2 pa7 pa0 pa1 pa2 pa3 pa4 pa5 pa6 data direction reg port a pb5/sdo pb6/sdi pb7/sck port b and siop registers and logic v dd v ss pd5 data direction register pc3/ad3 pc4/ad2 pc5/ad1 pc6/ad0 pc7/vr efh pc2 port c mux pc1 pc0 bootloader rom ? 239 bytes
general description advance information MC68HC705P6A ? rev. 2.0 22 general description motorola 1.4 functional pin description the following paragraphs describe the functionality of each pin on the MC68HC705P6A package. pins connected to subsystems described in other chapters provide a reference to the chapter instead of a detailed functional description. 1.4.1 v dd and v ss power is supplied to the mcu through v dd and v ss . v dd is connected to a regulated +5 volt supply and v ss is connected to ground. very fast signal transitions occur on the mcu pins. the short rise and fall times place very high short-duration current demands on the power supply. to prevent noise problems, take special care to provide good power supply bypassing at the mcu. use bypass capacitors with good high-frequency characteristics and position them as close to the mcu as possible. bypassing requirements vary, depending on how heavily the mcu pins are loaded. 1.4.2 osc1 and osc2 the osc1 and osc2 pins are the control connections for the on-chip oscillator. the osc1 and osc2 pins can accept the following: 1. a crystal as shown in figure 1-2 (a) 2. a ceramic resonator as shown in figure 1-2 (a) 3. an external clock signal as shown in figure 1-2 (b) the frequency, f osc , of the oscillator or external clock source is divided by two to produce the internal bus clock operating frequency, f op . the oscillator cannot be turned off by software unless the mor bit, swait, is clear when a stop instruction is executed.
general description functional pin description MC68HC705P6A ? rev. 2.0 advance information motorola general description 23 figure 1-2. oscillator connections 1.4.2.1 crystal the circuit in figure 1-2 (a) shows a typical oscillator circuit for an at-cut, parallel resonant crystal. follow the crystal manufacturer ? s recommendations, as the crystal parameters determine the external component values required to provide maximum stability and reliable startup. the load capacitance values used in the oscillator circuit design should include all stray capacitances. mount the crystal and components as close as possible to the pins for startup stabilization and to minimize output distortion. 1.4.2.2 ceramic resonator in cost-sensitive applications, use a ceramic resonator in place of a crystal. use the circuit in figure 1-2 (a) for a ceramic resonator and follow the resonator manufacturer ? s recommendations, as the resonator parameters determine the external component values required for maximum stability and reliable starting. the load capacitance values used in the oscillator circuit design should include all stray capacitances. mount the resonator and components as close as possible to the pins for startup stabilization and to minimize output distortion. to v dd (or stop ) to v dd (or stop) (a) crystal or ceramic resonator connections (b) external clock source connections osc1 osc2 mcu 37 pf 37 pf 4.7 m ? mcu osc1 osc2 unconnected external clock
general description advance information MC68HC705P6A ? rev. 2.0 24 general description motorola 1.4.2.3 external clock an external clock from another cmos-compatible device can be connected to the osc1 input, with the osc2 input not connected, as shown in figure 1-2 (b) . 1.4.3 reset driving this input low will reset the mcu to a known startup state. the reset pin contains an internal schmitt trigger to improve its noise immunity. refer to section 4. resets . 1.4.4 pa0 ? pa7 these eight i/o pins comprise port a. the state of any pin is software programmable and all port a lines are configured as inputs during power-on or reset. port a has mask-option register enabled interrupt capability with internal pullup devices selectable for any pin. refer to section 6. input/output ports . 1.4.5 pb5/sdo, pb6/sdi, and pb7/sck these three i/o pins comprise port b and are shared with the siop communications subsystem. the state of any pin is software programmable, and all port b lines are configured as inputs during power-on or reset. refer to section 6. input/output ports and section 7. serial input/output port (siop) . 1.4.6 pc0-pc2, pc3/ad3, pc4/ad2, pc5/ad1, pc6/ad0, and pc7/v refh these eight i/o pins comprise port c and are shared with the a/d converter subsystem. the state of any pin is software programmable and all port c lines are configured as inputs during power-on or reset. refer to section 6. input/output ports and section 9. analog subsystem .
general description functional pin description MC68HC705P6A ? rev. 2.0 advance information motorola general description 25 1.4.7 pd5 and pd7/tcap these two i/o pins comprise port d and one of them is shared with the 16-bit timer subsystem. the state of pd5 is software programmable and is configured as an input during power-on or reset. pd7 is always an input. it may be read at any time, regardless of which mode of operation the 16-bit timer is in. refer to section 6. input/output ports and section 8. capture/compare timer . 1.4.8 tcmp this pin is the output from the 16-bit timer ? s output compare function. it is low after reset. refer to section 8. capture/compare timer . 1.4.9 irq /v pp (maskable interrupt request) this input pin drives the asynchronous interrupt function of the mcu in user mode and provides the v pp programming voltage in bootloader mode. the mcu will complete the current instruction being executed before it responds to the irq interrupt request. when the irq /v pp pin is driven low, the event is latched internally to signify an interrupt has been requested. when the mcu completes its current instruction, the interrupt latch is tested. if the interrupt latch is set and the interrupt mask bit (i bit) in the condition code register is clear, the mcu will begin the interrupt sequence. depending on the mor level bit, the irq /v pp pin will trigger an interrupt on either a negative edge at the irq /v pp pin and/or while the irq /v pp pin is held in the low state. in either case, the irq /v pp pin must be held low for at least one t ilih time period. if the edge- and level- sensitive mode is selected (level bit set), the irq /v pp input pin requires an external resistor connected to v dd for wired-or operation. if the irq /v pp pin is not used, it must be tied to the v dd supply. the irq /v pp pin input circuitry contains an internal schmitt trigger to improve noise immunity. refer to section 5. interrupts . note: if the voltage level applied to the irq /v pp pin exceeds v dd , it may affect the mcu ? s mode of operation. see section 3. operating modes .
general description advance information MC68HC705P6A ? rev. 2.0 26 general description motorola
MC68HC705P6A ? rev. 2.0 advance information motorola memory 27 advance information ? MC68HC705P6A section 2. memory 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 2.3 user mode memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 2.4 bootloader mode memory map . . . . . . . . . . . . . . . . . . . . . . . .28 2.5 input/output and control registers . . . . . . . . . . . . . . . . . . . . .29 2.6 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2.7 eprom/rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 2.8 mask option register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.9 computer operating properly (cop) clear register . . . . . . . .34 2.2 introduction the MC68HC705P6A utilizes 13 address lines to access an internal memory space covering 8 kbytes. this memory space is divided into i/o, ram, rom, and eprom areas. 2.3 user mode memory map when the MC68HC705P6A is in the user mode, the 32 bytes of i/o, 176 bytes of ram, 4608 bytes of user eprom, 48 bytes of user page zero eprom, 239 bytes of bootloader rom, and 16 bytes of user vectors eprom are all active as shown in figure 2-1 .
memory advance information MC68HC705P6A ? rev. 2.0 28 memory motorola figure 2-1. MC68HC705P6A user mode memory map 2.4 bootloader mode memory map memory space is identical to the user mode. see figure 2-1 . $1f01 7937 mask option registers bootloader rom and vectors 239 bytes reset vector (low byte) reset vector (high byte) swi vector (low byte) swi vector (high byte) irq vector (low byte) irq vector (high byte) timer vector (low byte) timer vector (high byte) unused unused $1ff6 $1ff7 $1ff8 $1ff9 $1ffa $1ffb $1ffc $1ffd $1ffe $1fff unused $1ff5 unused $1ff4 unused $1ff3 unused $1ff2 unused $1ff1 cop clear register (1) $1ff0 $001f $0000 $0100 $00ff 0255 0256 stack 64 bytes internal ram 176 bytes i/o 32 bytes user vectors eprom 16 bytes 8191 8176 8175 7936 7935 4864 4863 0192 0191 0080 0079 0032 0031 0000 $1fff $1ff0 $1fef $1f00 $1eff $1300 $12ff $00c0 $00bf $0050 $004f $0020 $001f $0000 unimplemented 3071 bytes user eprom 4608 bytes user eprom 48 bytes i/o registers see figure 2-2 $1efe 7934 note 1. writing zero to bit 0 of $1ff0 clears the cop watchdog timer. reading $1ff0 returns user eprom data.
memory input/output and control registers MC68HC705P6A ? rev. 2.0 advance information motorola memory 29 2.5 input/output and control registers figure 2-2 and figure 2-3 briefly describe the i/o and control registers at locations $0000 ? $001f. reading unimplemented bits will return unknown states, and writing unimplemented bits will be ignored. port a data register $0000 port b data register $0001 port c data register $0002 port d data register $0003 port a data direction register $0004 port b data direction register $0005 port c data direction register $0006 port d data direction register $0007 unimplemented $0008 umimplemented $0009 siop control register $000a siop status register $000b siop data register $000c reserved $000d unimplemented $000e unimplemented $000f unimplemented $0010 unimplemented $0011 timer control register $0012 timer status register $0013 input capture msb $0015 input capture lsb $0016 output compare msb $0017 output compare lsb $0017 timer msb $0018 timer lsb $0019 alternate counter msb $001a alternate counter lsb $001b eprom programming register $001c a/d converter data register $001d a/d converter control and status register $001e reserved $001f figure 2-2. MC68HC705P6A i/o and control registers memory map
memory advance information MC68HC705P6A ? rev. 2.0 30 memory motorola 0 addr.register name bit 7654321bit 0 $0000 port a data register (porta) see page 52. read: pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 write: reset: unaffected by reset $0001 port b data register (portb) see page 53. read: pb7 pb6 pb5 00000 write: reset: unaffected by reset $0002 port c data register (portc) see page 54. read: pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 write: reset: unaffected by reset $0003 port d data register (portd) see page 55. read: pd7 0 pd5 10000 write: reset: unaffected by reset $0004 port a data direction register (ddra) see page 52. read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset:00000000 $0005 port b data direction register (ddrb) see page 53. read: ddrb7 ddrb6 ddrb5 11111 write: reset:00000000 $0006 port c data direction register (ddrc) see page 54. read: ddrc7 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset:00000000 $0007 port d data direction register (ddrd) see page 55. read: 0 0 ddrd5 00000 write: reset:00000000 $0008 unimplemented = unimplemented r = reserved u = undetermined figure 2-3. i/o and control register summary (sheet 1 of 4)
memory input/output and control registers MC68HC705P6A ? rev. 2.0 advance information motorola memory 31 $0009 unimplemented $000a siop control register (scr) see page 62. read: 0 spe 0 mstr 0000 write: reset:00000000 $000b siop status register (ssr) see page 63. read: spif dcol 000000 write: reset:00000000 $000c siop data register (sdr) see page 64. read: sdr7 sdr6 sdr5 sdr4 sdr3 ssdr2 sdr1 sdr0 write: reset: unaffected by reset $000d reserved for test rrrrrrrr $000e unimplemented $000f unimplemented $0010 unimplemented $0011 unimplemented $0012 timer control register (tcr) see page 68. read: icie ocie toie 000 iedg olvl write: reset:000000u0 $0013 timer status register (tsr) see page 70. read: icf ocf tof 00000 write: reset:uuu00000 addr.register name bit 7654321bit 0 = unimplemented r = reserved u = undetermined figure 2-3. i/o and control register summary (sheet 2 of 4)
memory advance information MC68HC705P6A ? rev. 2.0 32 memory motorola $0014 input capture register msb (icrh) see page 73. read: icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 write: reset: unaffected by reset $0015 input capture register lsb (icrl) see page 73. read: icrl7 icrl6 icrl5 icrl4 icrl3 icrl2 icrl1 icrl0 write: reset: unaffected by reset $0016 output compare register msb (ocrh) see page 74. read: ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 write: reset: unaffected by reset $0017 output compare register lsb (ocrl) see page 74. read: ocrl7 ocrl6 ocrl5 ocrl4 ocrl3 ocrl2 ocrl1 ocrl0 write: reset: unaffected by reset $0018 timer register msb (trh) see page 71. read: trh7 trh6 trh5 trh4 trh3 trh2 trh1 trh0 write: reset:11111111 $0019 timer register lsb (trl) see page 71. read: trl7 trl6 trl5 trl4 trl3 trl2 trl1 trl0 write: reset:11111100 $001a alternate timer register msb (atrh) see page 72. read: acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 write: reset:11111111 $001b alternate timer register lsb (atrl) see page 72. read: acrl7 acrl6 acrl5 acrl4 acrl3 acrl2 acrl1 acrl0 write: reset:11111100 $001c eprom programming register (eprog) see page 85. read: 00000 elat 0 epgm write: reset:00000000 addr.register name bit 7654321bit 0 = unimplemented r = reserved u = undetermined figure 2-3. i/o and control register summary (sheet 3 of 4)
memory ram MC68HC705P6A ? rev. 2.0 advance information motorola memory 33 2.6 ram the user ram consists of 176 bytes (including the stack) at locations $0050 through $00ff. the stack begins at address $00ff. the stack pointer can access 64 bytes of ram from $00ff to $00c0. note: using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. 2.7 eprom/rom there are 4608 bytes of user eprom at locations $0100 through $12ff, plus 48 bytes in user page zero locations $0020 through $004f, and 16 additional bytes for user vectors at locations $1ff0 through $1fff. the bootloader rom and vectors are at locations $1f01 through $1fef. $001d a/d conversion value data register (adc) see page 82. read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: unaffected by reset $001e a/d status and control register (adsc) see page 80. read: cc adrc adon 00 ch2 ch1 ch0 write: reset:00000000 $001f reserved for test rrrrrrrr addr.register name bit 7654321bit 0 = unimplemented r = reserved u = undetermined figure 2-3. i/o and control register summary (sheet 4 of 4)
memory advance information MC68HC705P6A ? rev. 2.0 34 memory motorola 2.8 mask option register the mask option register (mor) is a pair of eprom bytes located at $1eff and $1f00. it controls the programmable options on the MC68HC705P6A. see section 11. mask option register (mor) for additional information. 2.9 computer operating properly (cop) clear register the computer operating properly (cop) watchdog timer is located at address $1ff0. writing a logical 0 to bit zero of this location will clear the cop watchdog counter as described in 4.4.2 computer operating properly (cop) reset . $1effbit 7654321bit 0 read: pa7pu pa6pu pa5pu pa4pu pa3pu pa2pu pa1pu pa0pu write: erased state:00000000 $1f00bit 7654321bit 0 read: secure swait spr1 spr0 lsbf level cop write: erased state:00000000 = unimplemented figure 2-4. mask option register (mor) $1ff0bit 7654321bit 0 read: 0 0 000000 write: copr reset:00000000 = unimplemented figure 2-5. cop watchdog timer location
MC68HC705P6A ? rev. 2.0 advance information motorola operating modes 35 advance information ? MC68HC705P6A section 3. operating modes 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3 user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.4 bootloader mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5.1 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5.1.1 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.5.1.2 halt mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.5.2 wait instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 3.6 cop watchdog timer considerations . . . . . . . . . . . . . . . . . . .40 3.2 introduction the MC68HC705P6A has two modes of operation that affect the pinout and architecture of the mcu: user mode and bootloader mode. the user mode is normally used for the application and the bootloader mode is used for programming the eprom. the conditions required to enter each mode are shown in table 3-1 . the mode of operation is determined by the voltages on the irq /v pp and pd7/tcap pins on the rising edge of the external reset pin. table 3-1. operating mode conditions after reset reset pin irq /v pp pd7/tcap mode v ss to v dd v ss to v dd single chip v pp v dd bootloader
operating modes advance information MC68HC705P6A ? rev. 2.0 36 operating modes motorola the mode of operation is also determined whenever the internal computer operating properly (cop) watchdog timer resets the mcu. when the cop timer expires, the voltage applied to the irq /v pp pin controls the mode of operation while the voltage applied to pd7/tcap is ignored. the voltage applied to pd7/tcap during the last rising edge on reset is stored in a latch and used to determine the mode of operation when the cop watchdog timer resets the mcu. 3.3 user mode the user mode allows the mcu to function as a self-contained microcontroller, with maximum use of the pins for on-chip peripheral functions. all address and data activity occurs within the mcu and are not available externally. user mode is entered on the rising edge of reset if the irq /v pp pin is within the normal operating voltage range. the pinout for the user mode is shown in figure 3-1 . figure 3-1. user mode pinout in the user mode, there is an 8-bit i/o port, a second 8-bit i/o port shared with the analog-to-digital (a/d) subsystem, one 3-bit i/o port shared with the serial input/output port (siop), and a 3-bit port shared with the 16-bit timer subsystem, which includes one general-purpose i/o pin. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 reset irq /v pp pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 sdo/pb5 sdi/pb6 sck/pb7 v ss v dd osc1 osc2 pd7/tcap tcmp pd5 pc0 pc1 pc2 pc3/ad3 pc4/ad2 pc5/ad1 pc6/ad0 pc7/v refh
operating modes bootloader mode MC68HC705P6A ? rev. 2.0 advance information motorola operating modes 37 3.4 bootloader mode the bootloader mode provides a means to program the user eprom from an external memory device or host computer. this mode is entered on the rising edge of reset if v pp is applied to the irq /v pp pin and v dd is applied to the pd7/tcap pin. the user code in the external memory device must have data located in the same address space it will occupy in the internal mcu eprom, including the mask option register (mor) at $1eff and $1f00. 3.5 low-power modes the MC68HC705P6A is capable of running in a low-power mode in each of its configurations. the wait and stop instructions provide three modes that reduce the power required for the mcu by stopping various internal clocks and/or the on-chip oscillator. the swait bit in the mor is used to modify the behavior of the stop instruction from stop mode to halt mode. the flow of the stop, halt, and wait modes is shown in figure 3-2 . 3.5.1 stop instruction the stop instruction can result in one of two modes of operation depending on the state of the swait bit in the mor. if the swait bit is clear, the stop instruction will behave like a normal stop instruction in the m68hc05 family and place the mcu in stop mode. if the swait bit in the mor is set, the stop instruction will behave like a wait instruction (with the exception of a brief delay at startup) and place the mcu in halt mode. 3.5.1.1 stop mode execution of the stop instruction when the swait bit in the mor is clear places the mcu in its lowest power consumption mode. in stop mode, the internal oscillator is turned off, halting all internal processing, including the cop watchdog timer. execution of the stop instruction automatically clears the i bit in the condition code register so that the irq external interrupt is enabled. all other registers and memory remain unaltered. all input/output lines remain unchanged.
operating modes advance information MC68HC705P6A ? rev. 2.0 38 operating modes motorola figure 3-2. stop/wait flowcharts 1. fetch reset vector or 2. service interrupt a. stack b. set i bit c. vector to interrupt routine wait mor swait bit set? y n external reset ? y n irq external interrupt? y n stop external oscillator, stop internal timer clock, reset startup delay restart external oscillator, start stabilization delay stop internal processor clock, clear i bit in ccr end of stabilization delay? y n irq external interrupt? y n external oscillator active and internal timer clock active restart internal processor clock stop internal processor clock, clear i bit in ccr timer internal interrupt? y n external reset ? y n stop halt external reset ? y n irq external interrupt? y n stop internal processor clock, clear i bit in ccr external oscillator active and internal timer clock active timer internal interrupt? y n cop internal reset? y n cop internal reset? y n
operating modes low-power modes MC68HC705P6A ? rev. 2.0 advance information motorola operating modes 39 the mcu can be brought out of stop mode only by an irq external interrupt or an externally generated reset . when exiting stop mode, the internal oscillator will resume after a 4064 internal clock cycle oscillator stabilization delay. note: execution of the stop instruction when the swait bit in the mor is clear will cause the oscillator to stop, and, therefore, disable the cop watchdog timer. to avoid turning off the cop watchdog timer, stop mode should be changed to halt mode by setting the swait bit in the mor. see 3.6 cop watchdog timer considerations for additional information. 3.5.1.2 halt mode note: halt mode is not designed for intentional use. halt mode is only provided to keep the cop watchdog timer active in the event a stop instruction is executed inadvertently. this mode of operation is usually achieved by invoking wait mode. execution of the stop instruction when the swait bit in the mor is set places the mcu in this low-power mode. halt mode consumes the same amount of power as wait mode (both halt and wait modes consume more power than stop mode). in halt mode, the internal clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the 16-bit timer or a reset to be generated from the cop watchdog timer. execution of the stop instruction automatically clears the i bit in the condition code register, enabling the irq external interrupt. all other registers, memory, and input/output lines remain in their previous states. if the 16-bit timer interrupt is enabled, it will cause the processor to exit the halt mode and resume normal operation. the halt mode also can be exited when an irq external interrupt or external reset occurs. when exiting the halt mode, the internal clock will resume after a delay of one to 4064 internal clock cycles. this varied delay time is the result of the halt mode exit circuitry testing the oscillator stabilization delay
operating modes advance information MC68HC705P6A ? rev. 2.0 40 operating modes motorola timer (a feature of the stop mode), which has been free-running (a feature of the wait mode). 3.5.2 wait instruction the wait instruction places the mcu in a low-power mode which consumes more power than stop mode. in wait mode, the internal clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the 16-bit timer and reset to be generated from the cop watchdog timer. execution of the wait instruction automatically clears the i bit in the condition code register, enabling the irq external interrupt. all other registers, memory, and input/output lines remain in their previous state. if the 16-bit timer interrupt is enabled, it will cause the processor to exit wait mode and resume normal operation. the 16-bit timer may be used to generate a periodic exit from wait mode. wait mode may also be exited when an irq external interrupt or reset occurs. 3.6 cop watchdog timer considerations the cop watchdog timer is active in user mode of operation when the cop bit in the mor is set. executing the stop instruction when the swait bit in the mor is clear will cause the cop to be disabled. therefore, it is recommended that the stop instruction be modified to produce halt mode (set bit swait in the mor) if the cop watchdog timer is required to function at all times. furthermore, it is recommended that the cop watchdog timer be disabled for applications that will use the wait mode for time periods that will exceed the cop timeout period.
MC68HC705P6A ? rev. 2.0 advance information motorola resets 41 advance information ? MC68HC705P6A section 4. resets 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 4.3 external reset (reset ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.4.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.2 computer operating properly (cop) reset. . . . . . . . . . . . .42 4.2 introduction the mcu can be reset from three sources: one external input and two internal reset conditions. the reset pin is a schmitt trigger input as shown in figure 4-1 . the cpu and all peripheral modules will be reset by the rst signal which is the logical or of internal reset functions and is clocked by ph1. figure 4-1. reset block diagram d rst power-on reset (por) reset cop watchdog (copr) v dd osc data address dff to cpu and peripherals ph1 res
resets advance information MC68HC705P6A ? rev. 2.0 42 resets motorola 4.3 external reset (reset ) the reset input is the only external reset and is connected to an internal schmitt trigger. the external reset occurs whenever the reset input is driven below the lower threshold and remains in reset until the reset pin rises above the upper threshold. the upper and lower thresholds are given in section 14. electrical specifications . 4.4 internal resets the two internally generated resets are the initial power-on reset (por) function and the computer operating properly (cop) watchdog timer function. 4.4.1 power-on reset (por) the internal por is generated at power-up to allow the clock oscillator to stabilize. the por is strictly for power turn-on conditions and should not be used to detect a drop in the power supply voltage. there is a 4064 internal clock cycle oscillator stabilization delay after the oscillator becomes active. the por will generate the rst signal and reset the mcu. if any other reset function is active at the end of this 4064 internal clock cycle delay, the rst signal will remain active until the other reset condition(s) end. 4.4.2 computer operating properly (cop) reset when the cop watchdog timer is enabled (cop bit in the mor is set), the internal cop reset is generated automatically by a timeout of the cop watchdog timer. this timer is implemented with an 18-stage ripple counter that provides a timeout period of 65.5 ms when a 4-mhz oscillator is used. the cop watchdog counter is cleared by writing a logical 0 to bit zero at location $1ff0. the cop watchdog timer can be disabled by clearing the cop bit in the mor or by applying 2 x v dd to the irq /v pp pin (for example, during bootloader). when the irq /v pp pin is returned to its normal operating
resets internal resets MC68HC705P6A ? rev. 2.0 advance information motorola resets 43 voltage range (between v ss ? v dd ), the cop watchdog timer ? s output will be restored if the cop bit in the mask option register (mor) is set. the cop register is shared with the least significant byte (lsb) of an unused vector address as shown in figure 4-2 . reading this location will return the programmed value of the unused user interrupt vector, usually 0. writing to this location will clear the cop watchdog timer. when the cop watchdog timer expires, it will generate the rst signal and reset the mcu. if any other reset function is active at the end of the cop reset signal, the rst signal will remain in the reset condition until the other reset condition(s) end. when the reset condition ends, the mcu ? s operating mode will be selected (see table 3-1 ). address: $1ff0 bit 7654321bit 0 read: 0 0 000000 write: copr = unimplemented figure 4-2. unused vector and cop watchdog timer
resets advance information MC68HC705P6A ? rev. 2.0 44 resets motorola
MC68HC705P6A ? rev. 2.0 advance information motorola interrupts 45 advance information ? MC68HC705P6A section 5. interrupts 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 5.3 interrupt types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.3.1 reset interrupt sequence . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.3.2 software interrupt (swi). . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.3.3 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.3.3.1 external interrupt (irq ) . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.3.3.2 input capture interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . .49 5.3.3.3 output compare interrupt . . . . . . . . . . . . . . . . . . . . . . . .49 5.3.3.4 timer overflow interrupt . . . . . . . . . . . . . . . . . . . . . . . . .49 5.2 introduction the mcu can be interrupted six different ways: 1. non-maskable software interrupt instruction (swi) 2. external asynchronous interrupt (irq ) 3. input capture interrupt (timer) 4. output compare interrupt (timer) 5. timer overflow interrupt (timer) 6. port a interrupt (if selected via mask option register) interrupts cause the processor to save the register contents on the stack and to set the interrupt mask (i bit) to prevent additional interrupts. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is completed.
interrupts advance information MC68HC705P6A ? rev. 2.0 46 interrupts motorola when the current instruction is completed, the processor checks all pending hardware interrupts. if interrupts are not masked (i bit in the condition code register is clear) and the corresponding interrupt enable bit is set, the processor proceeds with interrupt processing. otherwise, the next instruction is fetched and executed. the swi is executed the same as any other instruction, regardless of the i-bit state. when an interrupt is to be processed, the cpu puts the register contents on the stack, sets the i bit in the ccr, and fetches the address of the corresponding interrupt service routine from the vector table at locations $1ff8 through $1fff. if more than one interrupt is pending when the interrupt vector is fetched, the interrupt with the highest vector location shown in table 5-1 will be serviced first. an rti instruction is used to signify when the interrupt software service routine is completed. the rti instruction causes the cpu state to be recovered from the stack and normal processing to resume at the next instruction that was to be executed when the interrupt took place. figure 5-1 shows the sequence of events that occurs during interrupt processing. table 5-1. vector addresses for interrupts and reset register flag name interrupts cpu interrupt vector address n/a n/a reset reset $1ffe ? $1fff n/a n/a software swi $1ffc ? $1ffd n/a n/a external interrupt irq $1ffa ? $1ffb tsr icf timer input capture timer $1ff8 ? $1ff9 tsr ocf timer output compare timer $1ff8 ? $1ff9 tsr tof timer overflow timer $1ff8 ? $1ff9
interrupts interrupt types MC68HC705P6A ? rev. 2.0 advance information motorola interrupts 47 figure 5-1. interrupt processing flowchart 5.3 interrupt types the interrupts fall into three categories: reset, software, and hardware. is i bit set? from reset load pc from: swi: $1ffc, $1ffd irq : $1ffa-$1ffb timer: $1ff8-$1ff9 set i bit in ccr stack pc, x, a, cc clear irq request latch restore resisters from stack cc, a, x, pc y n execute instruction fetch next instruction irq interrupt? y n timer interrupt? y n swi instruction? y n rti instruction? y n
interrupts advance information MC68HC705P6A ? rev. 2.0 48 interrupts motorola 5.3.1 reset interrupt sequence the reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner as shown in figure 5-1 . a low-level input on the reset pin or internally generated rst signal causes the program to vector to its starting address which is specified by the contents of memory locations $1ffe and $1fff. the i bit in the condition code register is also set. the mcu is configured to a known state during this type of reset as previously described in section 4. resets . 5.3.2 software interrupt (swi) the swi is an executable instruction. it is also a non-maskable interrupt since it is executed regardless of the state of the i bit in the ccr. as with any instruction, interrupts pending during the previous instruction will be serviced before the swi opcode is fetched. the interrupt service routine address for the swi instruction is specified by the contents of memory locations $1ffc and $1ffd. 5.3.3 hardware interrupts all hardware interrupts are maskable by the i bit in the ccr. if the i bit is set, all hardware interrupts (internal and external) are disabled. clearing the i bit enables the hardware interrupts. four hardware interrupts are explained in the following subsections. 5.3.3.1 external interrupt (irq ) the irq /v pp pin drives an asynchronous interrupt to the cpu. an edge detector flip-flop is latched on the falling edge of irq /v pp . if either the output from the internal edge detector flip-flop or the level on the irq /v pp pin is low, a request is synchronized to the cpu to generate the irq interrupt. if the level bit in the mask option register is clear (edge- sensitive only), the output of the internal edge detector flip-flop is sampled and the input level on the irq /v pp pin is ignored. the interrupt service routine address is specified by the contents of memory locations
interrupts interrupt types MC68HC705P6A ? rev. 2.0 advance information motorola interrupts 49 $1ffa and $1ffb. if the port a interrupts are enabled by the mor, they generate external interrupts identically to the irq /v pp pin. note: the internal interrupt latch is cleared nine internal clock cycles after the interrupt is recognized (immediately after location $1ffa is read). therefore, another external interrupt pulse could be latched during the irq service routine. another interrupt will be serviced if the irq pin is still in a low state when the rti in the service routine is executed. 5.3.3.2 input capture interrupt the input capture interrupt is generated by the 16-bit timer as described in section 8. capture/compare timer . the input capture interrupt flag is located in register tsr and its corresponding enable bit can be found in register tcr. the i bit in the ccr must be clear for the input capture interrupt to be enabled. the interrupt service routine address is specified by the contents of memory locations $1ff8 and $1ff9. 5.3.3.3 output compare interrupt the output compare interrupt is generated by a 16-bit timer as described in section 8. capture/compare timer . the output compare interrupt flag is located in register tsr and its corresponding enable bit can be found in register tcr. the i bit in the ccr must be clear for the output compare interrupt to be enabled. the interrupt service routine address is specified by the contents of memory locations $1ff8 and $1ff9. 5.3.3.4 timer overflow interrupt the timer overflow interrupt is generated by the 16-bit timer as described in section 8. capture/compare timer . the timer overflow interrupt flag is located in register tsr and its corresponding enable bit can be found in register tcr. the i bit in the ccr must be clear for the timer overflow interrupt to be enabled. this internal interrupt will vector to the interrupt service routine located at the address specified by the contents of memory locations $1ff8 and $1ff9.
interrupts advance information MC68HC705P6A ? rev. 2.0 50 interrupts motorola
MC68HC705P6A ? rev. 2.0 advance information motorola input/output ports 51 advance information ? MC68HC705P6A section 6. input/output ports 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 6.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 6.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 6.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.7 i/o port programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6.2 introduction in the user mode, 20 bidirectional i/o lines are arranged as two 8-bit i/o ports (ports a and c), one 3-bit i/o port (port b), and one 1-bit i/o port (port d). these ports are programmable as either inputs or outputs under software control of the data direction registers (ddrs). port d also contains one input-only pin.
input/output ports advance information MC68HC705P6A ? rev. 2.0 52 input/output ports motorola 6.3 port a port a is an 8-bit bidirectional port, which does not share any of its pins with other subsystems (see figure 6-1 ). the port a data register is located at address $0000 and its data direction register (ddr) is located at address $0004. the contents of the port a data register are indeterminate at initial power up and must be initialized by user software. reset does not affect the data registers, but does clear the ddrs, thereby setting all of the port pins to input mode. writing a 1 to a ddr bit sets the corresponding port pin to output mode. port a has mask option register enabled interrupt capability with an internal pullup device note: the keyscan (pullup/interrupt) feature available on port a is not available in the rom device, mc68hc05p6. figure 6-1. port a i/o and interrupt circuitry read $0000 write $0000 read $0004 data register bit i/o pin output internal hc05 data bus reset (rst) write $0004 data direction register bit to irq interrupt system v dd pullup mask option register
input/output ports port b MC68HC705P6A ? rev. 2.0 advance information motorola input/output ports 53 6.4 port b port b is a 3-bit bidirectional port which can share pins pb5 ? pb7 with the siop communications subsystem. the port b data register is located at address $0001 and its data direction register (ddr) is located at address $0005. the contents of the port b data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the ddrs, thereby setting all of the port pins to input mode. writing a 1 to a ddr bit sets the corresponding port pin to output mode (see figure 6-2 ). port b may be used for general i/o applications when the siop subsystem is disabled. the spe bit in register spcr is used to enable/disable the siop subsystem. when the siop subsystem is enabled, port b registers are still accessible to software. writing to either of the port b registers while a data transfer is under way could corrupt the data. see section 7. serial input/output port (siop) for a discussion of the siop subsystem. figure 6-2. port b i/o circuitry read $0001 write $0001 read $0005 data register bit i/o pin output internal hc05 data bus reset (rst) write $0005 data direction register bit
input/output ports advance information MC68HC705P6A ? rev. 2.0 54 input/output ports motorola 6.5 port c port c is an 8-bit bidirectional port which can share pins pc3 ? pc7 with the a/d subsystem. the port c data register is located at address $0002 and its data direction register (ddr) is located at address $0006. the contents of the port c data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the ddrs, thereby setting all of the port pins to input mode. writing a 1 to a ddr bit sets the corresponding port pin to output mode (see figure 6-3 ). port c may be used for general i/o applications when the a/d subsystem is disabled. the adon bit in register adsc is used to enable/disable the a/d subsystem. care must be exercised when using pins pc0 ? pc2 while the a/d subsystem is enabled. accidental changes to bits that affect pins pc3 ? pc7 in the data or ddr registers will produce unpredictable results in the a/d subsystem. see section 9. analog subsystem . figure 6-3. port c i/o circuitry read $0002 write $0002 read $0006 data register bit i/o pin output internal hc05 data bus reset (rst) write $0006 data direction register bit
input/output ports port d MC68HC705P6A ? rev. 2.0 advance information motorola input/output ports 55 6.6 port d port d is a 2-bit port with one bidirectional pin (pd5) and one input-only pin (pd7). pin pd7 is shared with the 16-bit timer. the port d data register is located at address $0003 and its data direction register (ddr) is located at address $0007. the contents of the port d data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the ddrs, thereby setting pd5 to input mode. writing a 1 to ddr bit 5 sets pd5 to output mode (see figure 6-4 ). port d may be used for general i/o applications regardless of the state of the 16-bit timer. since pd7 is an input-only line, its state can be read from the port d data register at any time. figure 6-4. port d i/o circuitry read $0003 write $0003 read $0007 data register bit i/o pin output internal hc05 data bus reset (rst) write $0007 data direction register bit
input/output ports advance information MC68HC705P6A ? rev. 2.0 56 input/output ports motorola 6.7 i/o port programming each pin on port a through port d (except pin 7 of port d) can be programmed as an input or an output under software control as shown in table 6-1 , table 6-2 , table 6-3 , and table 6-4 . the direction of a pin is determined by the state of its corresponding bit in the associated port data direction register (ddr). a pin is configured as an output if its corresponding ddr bit is set to a logic 1. a pin is configured as an input if its corresponding ddr bit is cleared to a logic 0. table 6-1. port a i/o functions ddra i/o pin mode accesses to ddra @ $0004 accesses to data register @ $0000 read/write read write 0 in, hi-z ddra0 ? ddra7 i/o pin see note 1 out ddra0 ? ddra7 pa0 ? pa7 pa0 ? pa7 note: does not affect input, but stored to data register table 6-2. port b i/o functions ddrb i/o pin mode accesses to ddrb @ $0005 accesses to data register @ $0001 read/write read write 0 in, hi-z ddrb5 ? ddrb7 i/o pin see note 1 out ddrb5 ? ddrb7 pb5 ? pb7 pb5 ? pb7 note: does not affect input, but stored to data register table 6-3. port c i/o functions ddrc i/o pin mode accesses to ddrc @ $0006 accesses to data register @ $0002 read/write read write 0 in, hi-z ddrc0 ? ddrc7 i/o pin see note 1 out ddrc0 ? ddrc7 pc0 ? pc7 pc0 ? pc7 note: does not affect input, but stored to data register
input/output ports i/o port programming MC68HC705P6A ? rev. 2.0 advance information motorola input/output ports 57 note: to avoid generating a glitch on an i/o port pin, data should be written to the i/o port data register before writing a logic 1 to the corresponding data direction register. at power-on or reset, all ddrs are cleared, which configures all port pins as inputs. the ddrs are capable of being written to or read by the processor. during the programmed output state, a read of the data register will actually read the value of the output data latch and not the level on the i/o port pin. table 6-4. port d i/o functions ddrd i/o pin mode accesses to ddrd @ $0007 accesses to data register @ $0003 read/write read write 0 in, hi-z ddrd5 i/o pin see note 1 1 out ddrd5 pd5 pd5 notes: 1. does not affect input, but stored to data register 2. pd7 is input only
input/output ports advance information MC68HC705P6A ? rev. 2.0 58 input/output ports motorola
MC68HC705P6A ? rev. 2.0 advance information motorola serial input/output port (siop) 59 advance information ? MC68HC705P6A section 7. serial input/output port (siop) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.3 siop signal format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.3.1 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 7.3.2 serial data input (sdi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 7.3.3 serial data output (sdo). . . . . . . . . . . . . . . . . . . . . . . . . . .61 7.4 siop registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.1 siop control register (scr) . . . . . . . . . . . . . . . . . . . . . . . .62 7.4.2 siop status register (ssr) . . . . . . . . . . . . . . . . . . . . . . . .63 7.4.3 siop data register (sdr). . . . . . . . . . . . . . . . . . . . . . . . . . 64 7.2 introduction the simple synchronous serial i/o port (siop) subsystem is designed to provide efficient serial communications between peripheral devices or other mcus. the siop is implemented as a 3-wire master/slave system with serial clock (sck), serial data input (sdi), and serial data output (sdo). a block diagram of the siop is shown in figure 7-1 . a mask programmable option determines whether the siop is msb or lsb first. the siop subsystem shares its input/output pins with port b. when the siop is enabled (spe bit set in register scr), port b ddr and data registers are modified by the siop. although port b ddr and data registers can be altered by application software, these actions could affect the transmitted or received data.
serial input/output port (siop) advance information MC68HC705P6A ? rev. 2.0 60 serial input/output port (siop) motorola figure 7-1. siop block diagram 7.3 siop signal format the siop subsystem is software configurable for master or slave operation. no external mode selection inputs are available (for instance, slave select pin). 7.3.1 serial clock (sck) the state of the sck output normally remains a logic 1 during idle periods between data transfers. the first falling edge of sck signals the beginning of a data transfer. at this time, the first bit of received data may be presented at the sdi pin and the first bit of transmitted data is presented at the sdo pin (see figure 7-2 ). data is captured at the sdi pin on the rising edge of sck. the transfer is terminated upon the eighth rising edge of sck. the master and slave modes of operation differ only by the sourcing of sck. in master mode, sck is driven from an internal source within the mcu. in slave mode, sck is driven from a source external to the mcu. the sck frequency is dependent upon the spr0 and spr1 bits located in the mask option register. refer to 11.3 mask option register for a description of available sck frequencies. 8-bit shift register status register baud rate control register generator hco5 internal bus internal cpu clock sck sdi sdo 76543210 76543210 76543210 i/o $0b $0c $0a control logic spe sdi/pb6 sck/pb7 sdo/pb5
serial input/output port (siop) siop signal format MC68HC705P6A ? rev. 2.0 advance information motorola serial input/output port (siop) 61 figure 7-2. siop timing diagram 7.3.2 serial data input (sdi) the sdi pin becomes an input as soon as the siop subsystem is enabled. new data may be presented to the sdi pin on the falling edge of sck.however, valid data must be present at least 100 nanoseconds before the rising edge of sck and remain valid for 100 nanoseconds after the rising edge of sck. see figure 7-2 . 7.3.3 serial data output (sdo) the sdo pin becomes an output as soon as the siop subsystem is enabled. prior to enabling the siop, pb5 can be initialized to determine the beginning state. while the siop is enabled, pb5 cannot be used as a standard output since that pin is connected to the last stage of the siop serial shift register. mask option register bit lsbf permits data to be transmitted in either the msb first format or the lsb first format. refer to 11.3 mask option register for mor lsbf programming information. on the first falling edge of sck, the first data bit will be shifted out to the sdo pin. the remaining data bits will be shifted out to the sdo pin on subsequent falling edges of sck. the sdo pin will present valid data at least 100 nanoseconds before the rising edge of the sck and remain valid for 100 nanoseconds after the rising edge of sck. see figure 7-2 . sck sdo sdi 100 ns 100 ns bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7
serial input/output port (siop) advance information MC68HC705P6A ? rev. 2.0 62 serial input/output port (siop) motorola 7.4 siop registers the siop is programmed and controlled by the siop control register (scr) located at address $000a, the siop status register (ssr) located at address $000b, and the siop data register (sdr) located at address $000c. 7.4.1 siop control register (scr) this register is located at address $000a and contains two bits. figure 7-3 shows the position of each bit in the register and indicates the value of each bit after reset. spe ? serial peripheral enable when set, the spe bit enables the siop subsystem such that sdo/pb5 is the serial data output, sdi/pb6 is the serial data input, and sck/pb7 is a serial clock input in the slave mode or a serial clock output in the master mode. port b ddr and data registers can be manipulated as usual (except for pb5); however, these actions could affect the transmitted or received data. the spe bit is readable at any time. however, writing to the siop control register while a transmission is in progress will cause the spif and dcol bits in the siop status register (see below) to operate incorrectly. therefore, the siop control register should be written once to enable the siop and then not written to until the siop is to be disabled. clearing the spe bit while a transmission is in progress address: $000a bit 7654321bit 0 read: 0 spe 0 mstr 0000 write: reset:00000000 = unimplemented figure 7-3. siop control register (scr)
serial input/output port (siop) siop registers MC68HC705P6A ? rev. 2.0 advance information motorola serial input/output port (siop) 63 will 1) abort the transmission, 2) reset the serial bit counter, and 3) convert the port b/siop port to a general-purpose i/o port. reset clears the spe bit. mstr ? master mode select when set, the mstr bit configures the serial i/o port for master mode. a transfer is initiated by writing to the sdr. also, the sck pin becomes an output providing a synchronous data clock dependent upon the oscillator frequency. when the device is in slave mode, the sdo and sdi pins do not change function. these pins behave exactly the same in both the master and slave modes. the mstr bit is readable and writeable at any time regardless of the state of the spe bit. clearing the mstr bit will abort any transfers that may have been in progress. reset clears the mstr bit as well as the spe bit, disabling the siop subsystem. 7.4.2 siop status register (ssr) this register is located at address $000b and contains two bits. figure 7-4 shows the position of each bit in the register and indicates the value of each bit after reset. spif ? serial port interface flag spif is a read-only status bit that is set on the last rising edge of sck and indicates that a data transfer has been completed. it has no effect on any future data transfers and can be ignored. the spif bit is address: $000b bit 7654321bit 0 read: spif dcol 000000 write: reset:00000000 = unimplemented figure 7-4. siop status register (ssr)
serial input/output port (siop) advance information MC68HC705P6A ? rev. 2.0 64 serial input/output port (siop) motorola cleared by reading the ssr followed by a read or write of the sdr. if the spif is cleared before the last rising edge of sck, it will be set again on the last rising edge of sck. reset clears the spif bit. dcol ? data collision dcol is a read-only status bit which indicates that an illegal access of the sdr has occurred. the dcol bit will be set when reading or writing the sdr after the first falling edge of sck and before spif is set. reading or writing the sdr during this time will result in invalid data being transmitted or received. the dcol bit is cleared by reading the ssr (when the spif bit is set) followed by a read or write of the sdr. if the last part of the clearing sequence is done after another transfer has started, the dcol bit will be set again. reset clears the dcol bit. 7.4.3 siop data register (sdr) this register is located at address $000c and serves as both the transmit and receive data register. writing to this register will initiate a message transmission if the siop is in master mode. the siop subsystem is not double buffered and any write to this register will destroy the previous contents. the sdr can be read at any time; however, if a transfer is in progress, the results may be ambiguous and the dcol bit will be set. writing to the sdr while a transfer is in progress can cause invalid data to be transmitted and/or received. figure 7-5 shows the position of each bit in the register. this register is not affected by reset. address: $000c bit 7654321bit 0 read: sd7 sd6 sd5 sd4 sd3 sd2 sd1 sd0 write: reset: unaffected by reset figure 7-5. serial port data register (sdr)
MC68HC705P6A ? rev. 2.0 advance information motorola capture/compare timer 65 advance information ? MC68HC705P6A section 8. capture/compare timer 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 8.3 timer operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 8.3.1 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 8.3.2 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 8.4 timer i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.4.1 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.4.2 timer status register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 8.4.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.4.4 alternate timer registers. . . . . . . . . . . . . . . . . . . . . . . . . . .72 8.4.5 input capture registers . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.4.6 output compare registers. . . . . . . . . . . . . . . . . . . . . . . . . .74 8.5 timer during wait/halt mode . . . . . . . . . . . . . . . . . . . . . . . . . .75 8.6 timer during stop mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 8.2 introduction this section describes the operation of the 16-bit capture/compare timer. figure 8-1 shows the structure of the capture/compare subsystem.
capture/compare timer advance information MC68HC705P6A ? rev. 2.0 66 capture/compare timer motorola figure 8-1. capture/compare timer block diagram 8.3 timer operation the core of the capture/compare timer is a 16-bit free-running counter. the counter provides the timing reference for the input capture and output compare functions. the input capture and output compare functions provide a means to latch the times at which external events occur, to measure input waveforms, and to generate output waveforms and timing delays. software can read the value in the 16-bit free-running counter at any time without affecting the counter sequence. because of the 16-bit timer architecture, the i/o registers for the input capture and output compare functions are pairs of 8-bit registers. input capture register clock internal bus output compare register high byte low byte $16 $17 333 4 internal processor 16-bit free running counter counter alternate register 8-bit buffer high byte low byte $1a $1b $18 $19 high byte low byte $14 $15 output compare circuit overflow detect circuit edge detect circuit timer status reg. icf ocf tof $13 icie iedg olvl output level reg. reset timer control reg. $12 output level (tcmp) interrupt circuit toie ocie edge input (tcap) d clk c q
capture/compare timer timer operation MC68HC705P6A ? rev. 2.0 advance information motorola capture/compare timer 67 because the counter is 16 bits long and preceded by a fixed divide-by-4 prescaler, the counter rolls over every 262,144 internal clock cycles. timer resolution with a 4-mhz crystal is 2 s. 8.3.1 input capture the input capture function is a means to record the time at which an external event occurs. when the input capture circuitry detects an active edge on the tcap pin, it latches the contents of the timer registers into the input capture registers. the polarity of the active edge is programmable. latching values into the input capture registers at successive edges of the same polarity measures the period of the input signal on the tcap pin. latching values into the input capture registers at successive edges of opposite polarity measures the pulse width of the signal. 8.3.2 output compare the output compare function is a means of generating an output signal when the 16-bit counter reaches a selected value. software writes the selected value into the output compare registers. on every fourth internal clock cycle the output compare circuitry compares the value of the counter to the value written in the output compare registers. when a match occurs, the timer transfers the programmable output level bit (olvl) from the timer control register to the tcmp pin. the programmer can use the output compare register to measure time periods, to generate timing delays, or to generate a pulse of specific duration or a pulse train of specific frequency and duty cycle on the tcmp pin.
capture/compare timer advance information MC68HC705P6A ? rev. 2.0 68 capture/compare timer motorola 8.4 timer i/o registers the following i/o registers control and monitor timer operation:  timer control register (tcr)  timer status register (tsr)  timer registers (trh and trl)  alternate timer registers (atrh and atrl)  input capture registers (icrh and icrl)  output compare registers (ocrh and ocrl) 8.4.1 timer control register the timer control register (tcr), shown in figure 8-2 , performs these functions:  enables input capture interrupts  enables output compare interrupts  enables timer overflow interrupts  controls the active edge polarity of the tcap signal  controls the active level of the tcmp output address: $0012 bit 7654321bit 0 read: icie ocie toie 000 iedg olvl write: reset:000000u0 = unimplemented u = undetermined figure 8-2. timer control register (tcr)
capture/compare timer timer i/o registers MC68HC705P6A ? rev. 2.0 advance information motorola capture/compare timer 69 icie ? input capture interrupt enable this read/write bit enables interrupts caused by an active signal on the tcap pin. resets clear the icie bit. 1 = input capture interrupts enabled 0 = input capture interrupts disabled ocie ? output compare interrupt enable this read/write bit enables interrupts caused by an active signal on the tcmp pin. resets clear the ocie bit. 1 = output compare interrupts enabled 0 = output compare interrupts disabled toie ? timer overflow interrupt enable this read/write bit enables interrupts caused by a timer overflow. reset clear the toie bit. 1 = timer overflow interrupts enabled 0 = timer overflow interrupts disabled iedg ? input edge the state of this read/write bit determines whether a positive or negative transition on the tcap pin triggers a transfer of the contents of the timer register to the input capture register. resets have no effect on the iedg bit. 1 = positive edge (low to high transition) triggers input capture 0 = negative edge (high to low transition) triggers input capture olvl ? output level the state of this read/write bit determines whether a logic 1 or logic 0 appears on the tcmp pin when a successful output compare occurs. resets clear the olvl bit. 1 = tcmp goes high on output compare 0 = tcmp goes low on output compare
capture/compare timer advance information MC68HC705P6A ? rev. 2.0 70 capture/compare timer motorola 8.4.2 timer status register the timer status register (tsr), shown in figure 8-3 , contains flags to signal the following conditions:  an active signal on the tcap pin, transferring the contents of the timer registers to the input capture registers  a match between the 16-bit counter and the output compare registers, transferring the olvl bit to the tcmp pin  a timer roll over from $ffff to $0000 icf ? input capture flag the icf bit is set automatically when an edge of the selected polarity occurs on the tcap pin. clear the icf bit by reading the timer status register with icf set and then reading the low byte ($0015) of the input capture registers. resets have no effect on icf. ocf ? output compare flag the ocf bit is set automatically when the value of the timer registers matches the contents of the output compare registers. clear the ocf bit by reading the timer status register with ocf set and then reading the low byte ($0017) of the output compare registers. resets have no effect on ocf. tof ? timer overflow flag the tof bit is set automatically when the 16-bit counter rolls over from $ffff to $0000. clear the tof bit by reading the timer status register with tof set, and then reading the low byte ($0019) of the timer registers. resets have no effect on tof. address: $0013 bit 7654321bit 0 read: icf ocf tof 00000 write: reset:uuu00000 u = undetermined figure 8-3. timer status register (tsr)
capture/compare timer timer i/o registers MC68HC705P6A ? rev. 2.0 advance information motorola capture/compare timer 71 8.4.3 timer registers the timer registers (trh and trl), shown in figure 8-4 , contains the current high and low bytes of the 16-bit counter. reading trh before reading trl causes trl to be latched until trl is read. reading trl after reading the timer status register clears the timer overflow flag (tof). writing to the timer registers has no effect. address: trh ? $0018 bit 7654321bit 0 read: trh7 trh6 trh5 trh4 trh3 trh2 trh1 trh0 write reset:11111111 address: trl ? $0019 bit 7654321bit 0 write: reset:11111100 = unimplemented figure 8-4. timer registers (trh and trl)
capture/compare timer advance information MC68HC705P6A ? rev. 2.0 72 capture/compare timer motorola 8.4.4 alternate timer registers the alternate timer registers (atrh and atrl), shown in figure 8-5 , contain the current high and low bytes of the 16-bit counter. reading atrh before reading atrl causes atrl to be latched until atrl is read. reading atrl has no effect on the timer overflow flag (tof). writing to the alternate timer registers has no effect. note: to prevent interrupts from occurring between readings of atrh and atrl, set the interrupt flag in the condition code register before reading atrh, and clear the flag after reading atrl. address: atrh ? $001a bit 7654321bit 0 read: acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 write: reset:11111111 address: atrl ? $001b bit 7654321bit 0 write: reset:11111100 = unimplemented figure 8-5. alternate timer registers (atrh and atrl)
capture/compare timer timer i/o registers MC68HC705P6A ? rev. 2.0 advance information motorola capture/compare timer 73 8.4.5 input capture registers when a selected edge occurs on the tcap pin, the current high and low bytes of the 16-bit counter are latched into the input capture registers. reading icrh before reading icrl inhibits further capture until icrl is read. reading icrl after reading the status register clears the input capture flag (icf). writing to the input capture registers has no effect. note: to prevent interrupts from occurring between readings of icrh and icrl, set the interrupt flag in the condition code register before reading icrh, and clear the flag after reading icrl. address: icrh ? $0014 bit 7654321bit 0 read: icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 write: unaffected by reset address: icrl ? $0015 bit 7654321bit 0 write: unaffected by reset = unimplemented figure 8-6. input capture registers (icrh and icrl)
capture/compare timer advance information MC68HC705P6A ? rev. 2.0 74 capture/compare timer motorola 8.4.6 output compare registers when the value of the 16-bit counter matches the value in the output compare registers, the planned tcmp pin action takes place. writing to ocrh before writing to ocrl inhibits timer compares until ocrl is written. reading or writing to ocrl after the timer status register clears the output compare flag (ocf). to prevent ocf from being set between the time it is read and the time the output compare registers are updated, use this procedure: 1. disable interrupts by setting the i bit in the condition code register. 2. write to ocrh. compares are now inhibited until ocrl is written. 3. clear bit ocf by reading timer status register (tsr). 4. enable the output compare function by writing to ocrl. 5. enable interrupts by clearing the i bit in the condition code register. address: ocrh ? $0016 bit 7654321bit 0 write: ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 read: unaffected by reset address: ocrl ? $0017 bit 7654321bit 0 read: unaffected by reset figure 8-7. output compare registers (ocrh and ocrl)
capture/compare timer timer during wait/halt mode MC68HC705P6A ? rev. 2.0 advance information motorola capture/compare timer 75 8.5 timer during wait/halt mode the cpu clock halts during the wait (or halt) mode, but the timer remains active. if interrupts are enabled, a timer interrupt will cause the processor to exit the wait mode. 8.6 timer during stop mode in the stop mode, the timer stops counting and holds the last count value if stop is exited by an interrupt. if stop is exited by reset, the counters are forced to $fffc. during stop, if at least one valid input capture edge occurs at the tcap pins, the input capture detect circuit is armed. this does not set any timer flags or wake up the mcu, but if an interrupt is used to exit stop mode, there is an active input capture flag and data from the first valid edge that occurred during the stop mode. if reset is used to exit stop mode, then no input capture flag or data remains, even if a valid input capture edge occurred.
capture/compare timer advance information MC68HC705P6A ? rev. 2.0 76 capture/compare timer motorola
MC68HC705P6A ? rev. 2.0 advance information motorola analog subsystem 77 advance information ? MC68HC705P6A section 9. analog subsystem 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 9.3 analog section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.3.1 ratiometric conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 9.3.2 reference voltage (v refh ) . . . . . . . . . . . . . . . . . . . . . . . . . 78 9.3.3 accuracy and precision . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.4 conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.5 digital section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.5.1 conversion times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.5.2 internal versus external oscillator . . . . . . . . . . . . . . . . . . . .79 9.5.3 multi-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . . .80 9.6 a/d status and control register (adsc) . . . . . . . . . . . . . . . . . 80 9.7 a/d conversion data register (adc). . . . . . . . . . . . . . . . . . . .82 9.8 a/d subsystem operation during halt/wait modes . . . . . . . . .82 9.9 a/d subsystem operation during stop mode. . . . . . . . . . . . . .82 9.2 introduction the MC68HC705P6A includes a 4-channel, multiplexed input, 8-bit, successive approximation analog-to-digital (a/d) converter. the a/d subsystem shares its inputs with port c pins pc3 ? pc7.
analog subsystem advance information MC68HC705P6A ? rev. 2.0 78 analog subsystem motorola 9.3 analog section the following paragraphs describe the operation and performance of analog modules within the analog subsystem. 9.3.1 ratiometric conversion the a/d converter is ratiometric, with pin v refh supplying the high reference voltage. applying an input voltage equal to v refh produces a conversion result of $ff (full scale). applying an input voltage equal to v ss produces a conversion result of $00. an input voltage greater than v refh will convert to $ff with no overflow indication. for ratiometric conversions, v refh should be at the same potential as the supply voltage being used by the analog signal being measured and referenced to v ss . 9.3.2 reference voltage (v refh ) the reference supply for the a/d converter shares pin pc7 with port c. the low reference is tied to the v ss pin internally. v refh can be any voltage between v ss and v dd ; however, the accuracy of conversions is tested and guaranteed only for v refh = v dd . 9.3.3 accuracy and precision the 8-bit conversion result is accurate to within 1 1/2 lsb, including quantization; however, the accuracy of conversions is tested and guaranteed only with external oscillator operation. 9.4 conversion process the a/d reference inputs are applied to a precision digital-to-analog converter. control logic drives the d/a and the analog output is successively compared to the selected analog input which was sampled at the beginning of the conversion cycle. the conversion process is monotonic and has no missing codes.
analog subsystem digital section MC68HC705P6A ? rev. 2.0 advance information motorola analog subsystem 79 9.5 digital section the following paragraphs describe the operation and performance of digital modules within the analog subsystem. 9.5.1 conversion times each input conversion requires 32 internal clock cycles, which must be at a frequency equal to or greater than 1 mhz. 9.5.2 internal versus external oscillator if the internal clock is 1 mhz or greater (i.e., external oscillator 2 mhz or greater), the internal rc oscillator must be turned off and the external oscillator used as the conversion clock. if the mcu internal clock frequency is less than 1 mhz (2 mhz external oscillator), the internal rc oscillator (approximately 1.5 mhz) must be used for the a/d converter clock. the internal rc clock is selected by setting the adrc bit in the adsc register. when the internal rc oscillator is being used, these limitations apply: 1. since the internal rc oscillator is running asynchronously with respect to the internal clock, the conversion complete bit (cc) in register adsc must be used to determine when a conversion sequence has been completed. 2. electrical noise will slightly degrade the accuracy of the a/d converter. the a/d converter is synchronized to read voltages during the quiet period of the clock driving it. since the internal and external clocks are not synchronized, the a/d converter will occasionally measure an input when the external clock is making a transition.
analog subsystem advance information MC68HC705P6A ? rev. 2.0 80 analog subsystem motorola 9.5.3 multi-channel operation an input multiplexer allows the a/d converter to select from one of four external analog signals. port c pins pc3 through pc6 are shared with the inputs to the multiplexer. 9.6 a/d status and control register (adsc) the adsc register reports the completion of a/d conversion and provides control over oscillator selection, analog subsystem power, and input channel selection. see figure 9-1 . cc ? conversion complete this read-only status bit is set when a conversion sequence has completed and data is ready to be read from the adc register. cc is cleared when the adsc is written to or when data is read from the adc register. once a conversion has been started, conversions of the selected channel will continue every 32 internal clock cycles until the adsc register is written to again. during continuous conversion operation, the adc register will be updated with new data, and the cc bit set every 32 internal clock cycles. also, data from the previous conversion will be overwritten regardless of the state of the cc bit. adrc ? rc oscillator control when adrc is set, the a/d subsystem operates from the internal rc oscillator instead of the internal clock. the rc oscillator requires a time, t rcon , to stabilize before accurate conversion results can be address: $001e bit 7654321bit 0 read: cc adrc adon 00 ch2 ch1 ch0 write: reset:00000000 = unimplemented figure 9-1. a/d status and control register (adsc)
analog subsystem a/d status and control register (adsc) MC68HC705P6A ? rev. 2.0 advance information motorola analog subsystem 81 obtained. see 9.3.2 reference voltage (vrefh) for more information. adon ? a/d subsystem on when the a/d subsystem is turned on (adon = 1), it requires a time, t adon , to stabilize before accurate conversion results can be attained. ch2 ? ch0 ? channel select bits ch2, ch1, and ch0 form a 3-bit field which is used to select an input to the a/d converter. channels 0 ? 3 correspond to port c input pins pc6 ? pc3. channels 4 ? 6 are used for reference measurements. channel 7 is reserved. if a conversion is attempted with channel 7 selected, the result will be $00. table 9-1 lists the inputs selected by bits ch0-ch3. if the adon bit is set and an input from channels 0 ? 4 is selected, the corresponding port c pin ? s ddr bit will be cleared (making that port c pin an input). if the port c data register is read while the a/d is on and one of the shared input channels is selected using bit ch0 ? ch2, the corresponding port c pin will read as a logic 0. the remaining port c pins will read normally. to digitally read a port c pin, the a/d subsystem must be disabled (adon = 0), or input channels 5 ? 7 must be selected. table 9-1. a/d multiplexer input channel assignments channel signal 0ad0 ? port c, bit 6 1ad1 ? port c, bit 5 2ad2 ? port c, bit 4 3ad3 ? port c, bit 3 4 v refh ? port c, bit 7 5 (v refh + v ss )/2 6 v ss 7 reserved for factory test
analog subsystem advance information MC68HC705P6A ? rev. 2.0 82 analog subsystem motorola 9.7 a/d conversion data register (adc) this register contains the output of the a/d converter. see figure 9-2 . 9.8 a/d subsystem operation during halt/wait modes the a/d subsystem continues normal operation during wait and halt modes. to decrease power consumption during wait or halt mode, the adon and adrc bits in the a/d status and control register should be cleared if the a/d subsystem is not being used. 9.9 a/d subsystem operation during stop mode when stop mode is enabled, execution of the stop instruction will terminate all a/d subsystem functions. any pending conversion is aborted. when the oscillator resumes operation upon leaving stop mode, a finite amount of time passes before the a/d subsystem stabilizes sufficiently to provide conversions at its rated accuracy. the delays built into the MC68HC705P6A when coming out of stop mode are sufficient for this purpose. no explicit delays need to be added to the application software. address: $001d bit 7654321bit 0 read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: unaffected by reset = unimplemented figure 9-2. a/d conversion value data register (adc)
MC68HC705P6A ? rev. 2.0 advance information motorola eprom 83 advance information ? MC68HC705P6A section 10. eprom 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 10.3 eprom erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 10.4 eprom programming sequence. . . . . . . . . . . . . . . . . . . . . . .84 10.5 eprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 10.6 eprom programming register (eprog) . . . . . . . . . . . . . . . .84 10.7 eprom bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 10.8 programming from an external memory device. . . . . . . . . . . .87 10.2 introduction the user eprom consists of 48 bytes of user page zero eprom from $0020 to $004f, 4608 bytes of user eprom from $0100 to $12ff, the two mor reset values located at $1eff and $1f00, and 16 bytes of user vectors eprom from $1ff0 to $1fff. the bootloader rom and vectors are located from $1f01 to $1fef. 10.3 eprom erasing note: only parts packaged in a windowed package may be erased. others are one-time programmable and may not be erased by uv exposure. the MC68HC705P6A can be erased by exposure to a high-intensity ultraviolet (uv) light with a wavelength of 2537 angstroms. the recommended dose (uv intensity multiplied by exposure time) is 15 ws/cm 2 . uv lamps without shortwave filters should be used, and the
eprom advance information MC68HC705P6A ? rev. 2.0 84 eprom motorola eprom device should be positioned about one inch from the uv lamp. an erased eprom byte will read as $00. 10.4 eprom programming sequence the bootloader software goes through a complete write cycle of the eprom including the mor. this is followed by a verify cycle which continually branches in a loop if an error is found. a sample routine to program a byte of eprom is shown in table 10-1 . note: to avoid damage to the mcu, v dd must be applied to the mcu before v pp . 10.5 eprom registers three registers are associated with the eprom: the eprom programming register (eprog) and the two mask option registers (mor). the eprog register controls the actual programming of the eprom bytes and the mor. the mor registers control the six mask options found on the rom version of this mcu (mc68hc05p6), the eprom security feature, and eight additional port a interrupt options. 10.6 eprom programming register (eprog) this register is used to program the eprom array. only the elat and epgm bits are available. table 10-1 shows the location of each bit in the eprog register and the state of these bits coming out of reset. all the bits in the eprog register are cleared by reset.
eprom eprom programming register (eprog) MC68HC705P6A ? rev. 2.0 advance information motorola eprom 85 epgm ? eprom program control if the epgm bit is set, programming power is applied to the eprom array. if the epgm bit is cleared, programming power is removed from the eprom array. the epgm bit cannot be set unless the elat bit is set already. whenever the elat bit is cleared, the epgm bit is cleared also. both the epgm and the elat bit cannot be set using the same write instruction. any attempt to set both the epgm and elat bit on the same write instruction cycle will result in the elat bit being set and the epgm bit being cleared. the epgm bit is a read-write bit and can be read at any time. the epgm bit is cleared by reset. elat ? eprom latch control if the elat bit is set, the eprom address and data bus are configured for programming to the array. if the elat bit is cleared, the eprom address and data bus are configured for normal reading of data from the array. when the elat bit is set, the address and data bus are latched in the eprom array when a subsequent write to the array is made. data in the eprom array cannot be read if the elat bit is set. whenever the elat bit is cleared, the epgm bit is cleared also. both the epgm and the elat bit cannot be set using the same write instruction. any attempt to set both the epgm and elat bit on the same write instruction cycle will result in the elat bit being set and the epgm bit being cleared. the elat bit is a read-write bit and can be read at any time. the elat bit is cleared by reset. address $001c bit 7654321bit 0 read: 0 0 0 0 0 elat 0 epgm write: reset:00000000 = unimplemented figure 10-1. eprom programming register (eprog)
eprom advance information MC68HC705P6A ? rev. 2.0 86 eprom motorola to program a byte of eprom, manipulate the eprog register as follows: 1. set the elat bit in the eprog register. 2. write the desired data to the desired eprom address. 3. set the epgm bit in the eprog register for the specified programming time, t epgm . 4. clear the elat and epgm bits in the eprog register. this sequence is also shown in the sample program listing in table 10-1 . 10.7 eprom bootloader three port pins are associated with bootloader control functions: pc3, pc4, and pc6. table 10-2 summarizes their functionality. table 10-1. eprom programming routine 001c 0055 0700 0000 eprog data eprom epgm equ $1c equ $55 equ $700 equ $00 programming reg data value a sample eprom adx epgm bit in eprog reg 00d0 org $d0 00d0 00d2 00d4 00d6 00d9 00db 00dd 00df a6 02 b7 1c a6 55 c7 07 00 10 1c ad 03 3f 1c 81 lda #$04 sta eprog lda #data sta eprom bset epgm, eprog bsr delay clr eprog rts set lat bit in eprog data byte write it to eprom loc turn on pgm voltage wait 4 ms minimum clr lat and pgm bits table 10-2. bootloader control pins pc6 pc4 pc3 mode 1 1 1 program/verify 110 verify only 1 0 0 dump mcu eprom to port a
eprom programming from an external memory device MC68HC705P6A ? rev. 2.0 advance information motorola eprom 87 10.8 programming from an external memory device in this programming mode, pc5 must be connected to v ss . pc4 and pc3 are used to select the programming mode. the programming circuit shown in figure 10-2 uses an external 12-bit counter to address the memory device containing the code to be copied. this counter requires a clock and a reset function. the 12-bit counter can address up to 4 kbytes of memory, which means that a port pin has to be used to address the remaining 4 k of the 8-k memory space. the following procedure explains how to use the programming circuit shown in figure 10-2 to copy a user program from an external memory device into the mcu ? s eprom: 1. program a 2764-type eprom device with the desired instructions and data. code programmed into the 2764 must appear at the same addresses desired in the MC68HC705P6A. therefore, the page zero code must start at $0020 and end at $004f, the main body of code must start at $0100 and end at $12ff, and the user vectors must start at $1ff0 and end at $1fff. note: the mor data must appear at $1eff and $1f00. 2. install the programmed 2764 device into the programming circuit. 3. install the MC68HC705P6A to be programmed into the programming circuit. 4. set the program and/or verify switches for the desired operation (an open switch is the active state) and close the reset switch to hold the mcu in reset. 5. make sure that the v pp source is off. 6. apply the v dd source to the programming circuit. 7. apply the v pp source to the programming circuit. 8. open the reset switch to allow the mcu to come out of reset and begin execution of the software in its internal bootloader rom.
eprom advance information MC68HC705P6A ? rev. 2.0 88 eprom motorola 9. wait for programming and/or verification to complete (about 40 seconds). the program led will light during programming and the verify led will light if verification was requested and was successful. 10. when complete, close the reset switch to force the mcu into the reset state. 11. turn off the v pp source. 12. turn off the v dd source. 13. remove device(s).
eprom programming from an external memory device MC68HC705P6A ? rev. 2.0 advance information motorola eprom 89 figure 10-2. MC68HC705P6A eprom programming flowchart n program 2764 type eprom install eprom into programmer install MC68HC705P6A into programmer programming? open program switch close program switch y n verifying? open verify switch close verify switch y n close reset switch make sure v pp is off turn v dd on turn v pp on open reset switch programming? wait for programming led to y turn on and off. verifying? wait for 30 seconds y n is verify led lit? y n verification complete close reset switch turn off v pp turn off v dd verification failed remove devices
eprom advance information MC68HC705P6A ? rev. 2.0 90 eprom motorola figure 10-3. MC68HC705P6A eprom programming schematic diagram v dd q12 q11 q10 q9 q8 q7 q6 q5 q4 q3 q2 q1 clk rst pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 mc74hc4040 osc1 osc2 reset pb7 pb6 pc2 pc1 irq /v pp prog verf pc3 pc4 pc6 v dd = 5.0 v v pp = 16.5 v v dd v dd v dd v dd v pp 2 0 pf 10 m ? 2 mhz 20 pf 10 k ? 10 k ? 10 k ? 10 k ? 330 ? 330 ? 1 f MC68HC705P6A reset a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 a12 d7 d6 d5 d4 d3 d2 d1 d0 2764 ce oe pgm v dd 10 k ? pb5 pd7/tcap v dd pgm vfy pc5
MC68HC705P6A ? rev. 2.0 advance information motorola mask option register (mor) 91 advance information ? MC68HC705P6A section 11. mask option register (mor) 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 11.3 mask option register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 11.4 mor programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 11.2 introduction the mask option register (mor) contains two bytes of eprom used to enable or disable each of the features controlled by mask options on the mc68hc05p6 (a rom version of the MC68HC705P6A). the seven programmable options on the MC68HC705P6A are: 1. cop watchdog timer (enable or disable) 2. irq triggering (edge- or edge- and level-sensitive) 3. siop data bit order (most significant bit or least significant bit first) 4. siop clock rate (osc divided by 8, 16, 32, or 64) 5. stop instruction mode (stop mode or halt mode) 6. secure eprom from external reading 7. keyscan interrupt/pullups on pa0 ? pa7 11.3 mask option register mask options are programmed into the mask option register (mor) by the firmware in the bootloader rom. see figure 11-1 .
mask option register (mor) advance information MC68HC705P6A ? rev. 2.0 92 mask option register (mor) motorola cop ? cop watchdog enable setting the cop bit will enable the cop watchdog timer. the cop will reset the mcu if the timeout period is reached before the cop watchdog timer is cleared by the application software and the voltage applied to the irq /v pp pin is between v ss and v dd . clearing the cop bit will disable the cop watchdog timer regardless of the voltage applied to the irq /v pp pin. level ? irq edge sensitivity if the level bit is clear, the irq /v pp pin will only be sensitive to the falling edge of the signal applied to the irq /v pp pin. if the level bit is set, the irq /v pp pin will be sensitive to both the falling edge of the input signal and the logic low level of the input signal on the irq /v pp pin. lsbf ? siop least significant bit first if the lsbf bit is set, the serial data to and from the siop will be transferred least significant bit first. if the lsbf bit is clear, the serial data to and from the siop will be transferred most significant bit first. address: $1eff bit 7654321bit 0 read: pa7pu pa6pu pa5pu pa4pu pa3pu pa2pu pa1pu pa0pu write: erased state:00000000 address: $1f00 bit 7654321bit 0 read: secure swait spr1 spr0 lsbf level cop write: erased state:00000000 = unimplemented figure 11-1. mask option register (mor)
mask option register (mor) mask option register MC68HC705P6A ? rev. 2.0 advance information motorola mask option register (mor) 93 spr0 and spr1 ? siop clock rate the spr0 and spr1 bits determine the clock rate used to transfer the serial data to and from the siop. the various clock rates available are given in table 11-1 . swait ? stop instruction mode setting the swait bit will prevent the stop instruction from stopping the on-board oscillator. clearing the swait bit will permit the stop instruction to stop the on-board oscillator and place the mcu in stop mode. executing the stop instruction when swait is set will place the mcu in halt mode. see 3.5.1 stop instruction for additional information. secure ? security state (1) if secure bit is set, the eprom is locked. pa(0:7)pu ? port a pullups/interrupt enable/disable if any pa(0:7)pu is selected, that pullup/interrupt is enabled. the interrupt sensitivity will be selected via the level bit in the same way as the irq pin. note: the port a pullup/interrupt function is not available on the rom device, mc68hc05p6. table 11-1. siop clock rate spr1 spr0 siop master clock 00 f osc 64 01 f osc 32 10 f osc 16 11 f osc 8 1. no security feature is absolutely secure. however, motorola ? s strategy is to make reading or copying the eprom/otprom difficult for unauthorized users.
mask option register (mor) advance information MC68HC705P6A ? rev. 2.0 94 mask option register (mor) motorola 11.4 mor programming the contents of the mor should be programmed in bootloader mode using the hardware shown in figure 10-2 . in order to allow programming, all the implemented bits in the mor are essentially read- write bits in bootloader mode as shown in figure 11-1 . the programming of the mor is the same as user eprom. 1. set the elat bit in the eprog register. 2. write the desired data to the desired mor address. 3. set the epgm bit in the eprog. 4. wait for the programming time (t epgm ). 5. clear the elat and epgm bits in the eprog. 6. remove the programming voltage from the irq /v pp pin. a sample routine to program a byte of eprom is shown in table 11-2 . once the mor bits have been programmed, the options are not loaded into the mor registers until the part is reset. table 11-2. mor programming routine 001c 00ff 0023 1eff 1f00 0000 eprog data2 data1 mor2 mor1 epgm equ $1c equ $ff equ #23 equ $1eff equ $1f00 equ $00 programming reg sample mor values mopr addresses epgm bit in eprog reg 00e0 org $e0 00e0 00e2 00e4 00e6 00e9 00eb 00ed 00ef a6 04 b7 1c a6 ff c7 1e ff 12 1c ad 03 3f 1c 81 lda #$04 sta eprog lda #data2 sta mor2 bset epgm,eprog bsr delay clr eprog rts set elat bit in epgm reg at $1c data byte write it to mor loc turn on pgm voltage wait 4 ms minimum clr epgm register
MC68HC705P6A ? rev. 2.0 advance information motorola central processor unit (cpu) core 95 advance information ? MC68HC705P6A section 12. central processor unit (cpu) core 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 12.3 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 12.3.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 12.3.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 12.3.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 12.3.4 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 12.3.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 12.2 introduction the MC68HC705P6A has an 8-k memory map. therefore, it uses only the lower 13 bits of the address bus. in the following discussion, the upper three bits of the address bus can be ignored. also, the stop instruction can be modified to place the mcu in either the normal stop mode or the halt mode by means of a mor bit. all other instructions and registers behave as described in this section. 12.3 registers the mcu contains five registers which are hard-wired within the cpu and are not part of the memory map. these five registers are shown in figure 12-1 and are described in the following paragraphs.
central processor unit (cpu) core advance information MC68HC705P6A ? rev. 2.0 96 central processor unit (cpu) core motorola figure 12-1. mc68hc05 programming model 12.3.1 accumulator the accumulator is a general-purpose 8-bit register as shown in figure 12-1 . the cpu uses the accumulator to hold operands and results of arithmetic calculations or non-arithmetic operations. the accumulator is unaffected by a reset of the device. 12.3.2 index register the index register shown in figure 12-1 is an 8-bit register that can perform two functions:  indexed addressing  temporary storage in indexed addressing with no offset, the index register contains the low byte of the operand address, and the high byte is assumed to be $00. in indexed addressing with an 8-bit offset, the cpu finds the operand address by adding the index register contents to an 8-bit immediate value. in indexed addressing with a 16-bit offset, the cpu finds the condition code register i accumulator 60 a index register 71 x 4 52 3 stack pointer sp 14 8 15 9 12 13 10 11 pc cc 111 11 0 0 0 0 0 0 0 0 program counter hnzc half-carry bit (from bit 3) interrupt mask negative bit zero bit carry bit
central processor unit (cpu) core registers MC68HC705P6A ? rev. 2.0 advance information motorola central processor unit (cpu) core 97 operand address by adding the index register contents to a 16-bit immediate value. the index register can also serve as an auxiliary accumulator for temporary storage. the index register is unaffected by a reset of the device. 12.3.3 stack pointer the stack pointer shown in figure 12-1 is a 16-bit register internally. in devices with memory maps less than 64 kbytes, the unimplemented upper address lines are ignored. the stack pointer contains the address of the next free location on the stack. during a reset or the reset stack pointer (rsp) instruction, the stack pointer is set to $00ff. the stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled from the stack. when accessing memory, the 10 most significant bits are permanently set to 0000000011. the six least significant register bits are appended to these 10 fixed bits to produce an address within the range of $00ff to $00c0. subroutines and interrupts may use up to 64 ($40) locations. if 64 locations are exceeded, the stack pointer wraps around and writes over the previously stored information. a subroutine call occupies two locations on the stack and an interrupt uses five locations. 12.3.4 program counter the program counter shown in figure 12-1 is a 16-bit register internally. in devices with memory maps less than 64 kbytes, the unimplemented upper address lines are ignored. the program counter contains the address of the next instruction or operand to be fetched. normally, the address in the program counter increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location.
central processor unit (cpu) core advance information MC68HC705P6A ? rev. 2.0 98 central processor unit (cpu) core motorola 12.3.5 condition code register the ccr shown in figure 12-1 is a 5-bit register in which four bits are used to indicate the results of the instruction just executed. the fifth bit is the interrupt mask. these bits can be individually tested by a program, and specific actions can be taken as a result of their state. the condition code register should be thought of as having three additional upper bits that are always ones. only the interrupt mask is affected by a reset of the device. the following paragraphs explain the functions of the lower five bits of the condition code register. h ? half carry bit when the half-carry bit is set, it means that a carry occurred between bits 3 and 4 of the accumulator during the last add or adc (add with carry) operation. the half-carry bit is required for binary-coded decimal (bcd) arithmetic operations. i ? interrupt mask bit when the interrupt mask is set, the internal and external interrupts are disabled. interrupts are enabled when the interrupt mask is cleared. when an interrupt occurs, the interrupt mask is automatically set after the cpu registers are saved on the stack, but before the interrupt vector is fetched. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the interrupt is processed as soon as the interrupt mask is cleared. a return from interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its state before the interrupt was encountered. after any reset, the interrupt mask is set and can only be cleared by the clear i bit (cli), stop, or wait instructions. n ? negative bit the negative bit is set when the result of the last arithmetic operation, logical operation, or data manipulation was negative. (bit 7 of the result was a logic one.) the negative bit can also be used to check an often-tested flag by assigning the flag to bit 7 of a register or memory location. loading the accumulator with the contents of that register or location then sets or clears the negative bit according to the state of the flag.
central processor unit (cpu) core registers MC68HC705P6A ? rev. 2.0 advance information motorola central processor unit (cpu) core 99 z ? zero bit the zero bit is set when the result of the last arithmetic operation, logical operation, data manipulation, or data load operation was zero. c ? carry/borrow bit the carry/borrow bit is set when a carry out of bit 7 of the accumulator occurred during the last arithmetic operation, logical operation, or data manipulation. the carry/borrow bit is also set or cleared during bit test and branch instructions and during shifts and rotates. this bit is not set by an inc or dec instruction.
central processor unit (cpu) core advance information MC68HC705P6A ? rev. 2.0 100 central processor unit (cpu) core motorola
MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 101 advance information ? MC68HC705P6A section 13. instruction set 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 13.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 13.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 13.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 13.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 13.3.7 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 13.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 13.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 13.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .105 13.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .106 13.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .107 13.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .109 13.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 13.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 13.6 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 13.2 introduction the mcu instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos family plus one more: the unsigned multiply (mul) instruction. the mul instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is
instruction set advance information MC68HC705P6A ? rev. 2.0 102 instruction set motorola stored in the index register, and the low-order product is stored in the accumulator. 13.3 addressing modes the cpu uses eight addressing modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are:  inherent  immediate  direct  extended  indexed, no offset  indexed, 8-bit offset  indexed, 16-bit offset  relative 13.3.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. 13.3.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no operand address and are two bytes long. the opcode is the first byte, and the immediate data value is the second byte.
instruction set addressing modes MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 103 13.3.3 direct direct instructions can access any of the first 256 memory locations with two bytes. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. 13.3.4 extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. 13.3.5 indexed, no offset indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000 ? $00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 13.3.6 indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the effective address of the operand. these instructions can access locations $0000 ? $01fe.
instruction set advance information MC68HC705P6A ? rev. 2.0 104 instruction set motorola indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. 13.3.7 indexed,16-bit offset indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the effective address of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. 13.3.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, two ? s complement byte that gives a branching range of ? 128 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch.
instruction set instruction types MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 105 13.4 instruction types the mcu instructions fall into the following five categories:  register/memory instructions  read-modify-write instructions  jump/branch instructions  bit manipulation instructions  control instructions 13.4.1 register/memory instructions these instructions operate on cpu registers and memory locations. most of them use two operands. one operand is in either the accumulator or the index register. the cpu finds the other operand in memory. table 13-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub
instruction set advance information MC68HC705P6A ? rev. 2.0 106 instruction set motorola 13.4.2 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. note: do not use read modify-write operations on write-only registers. table 13-2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) 1. unlike other read-modify-write instructions, bclr and bset use only direct addressing. bit set bset (1) clear register clr complement (one ? s complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (two ? s complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) 2. tst is an exception to the read-modify-write sequence because it does not write a replacement value.
instruction set instruction types MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 107 13.4.3 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch based on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ? 128 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register.
instruction set advance information MC68HC705P6A ? rev. 2.0 108 instruction set motorola table 13-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr
instruction set instruction types MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 109 13.4.4 bit manipulation instructions the cpu can set or clear any writable bit in the first 256 bytes of memory, which includes i/o registers and on-chip ram locations. the cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. 13.4.5 control instructions these instructions act on cpu registers and control cpu operation during program execution. table 13-4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset table 13-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait
instruction set advance information MC68HC705P6A ? rev. 2.0 110 instruction set motorola 13.5 instruction set summary table 13-6. instruction set summary (sheet 1 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a (a) + (m) + (c)  ?  imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a (a) + (m)  ?  imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a (a) (m) ??  ? imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) ??  dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right ??  dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc (pc) + 2 + rel ? c = 0 ????? rel 24 rr 3 bclr n opr clear bit n mn 0 ????? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc (pc) + 2 + rel ? c = 1 ????? rel 25 rr 3 beq rel branch if equal pc (pc) + 2 + rel ? z = 1 ????? rel 27 rr 3 bhcc rel branch if half-carry bit clear pc (pc) + 2 + rel ? h = 0 ????? rel 28 rr 3 bhcs rel branch if half-carry bit set pc (pc) + 2 + rel ? h = 1 ????? rel 29 rr 3 bhi rel branch if higher pc (pc) + 2 + rel ? c z = 0 ????? rel 22 rr 3 bhs rel branch if higher or same pc (pc) + 2 + rel ? c = 0 ????? rel 24 rr 3 c b0 b7 0 b0 b7 c
instruction set instruction set summary MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 111 bih rel branch if irq pin high pc (pc) + 2 + rel ? irq = 1 ????? rel 2f rr 3 bil rel branch if irq pin low pc (pc) + 2 + rel ? irq = 0 ????? rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) ??  ? imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc (pc) + 2 + rel ? c = 1 ????? rel 25 rr 3 bls rel branch if lower or same pc (pc) + 2 + rel ? c z = 1 ????? rel 23 rr 3 bmc rel branch if interrupt mask clear pc (pc) + 2 + rel ? i = 0 ????? rel 2c rr 3 bmi rel branch if minus pc (pc) + 2 + rel ? n = 1 ????? rel 2b rr 3 bms rel branch if interrupt mask set pc (pc) + 2 + rel ? i = 1 ????? rel 2d rr 3 bne rel branch if not equal pc (pc) + 2 + rel ? z = 0 ????? rel 26 rr 3 bpl rel branch if plus pc (pc) + 2 + rel ? n = 0 ????? rel 2a rr 3 bra rel branch always pc (pc) + 2 + rel ? 1 = 1 ????? rel 20 rr 3 brclr n opr rel branch if bit n clear pc (pc) + 2 + rel ? mn = 0 ????  dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc (pc) + 2 + rel ? 1 = 0 ????? rel 21 rr 3 brset n opr rel branch if bit n set pc (pc) + 2 + rel ? mn = 1 ????  dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n opr set bit n mn 1 ????? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc (pc) + 2; push (pcl) sp (sp) ? 1; push (pch) sp (sp) ? 1 pc (pc) + rel ????? rel ad rr 6 clc clear carry bit c 0 ???? 0inh98 2 cli clear interrupt mask i 0 ? 0 ??? inh 9a 2 table 13-6. instruction set summary (sheet 2 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
instruction set advance information MC68HC705P6A ? rev. 2.0 112 instruction set motorola clr opr clra clrx clr opr ,x clr ,x clear byte m $00 a $00 x $00 m $00 m $00 ?? 01 ? dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ? (m) ??  imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (one ? s complement) m ( m ) = $ff ? (m) a ( a ) = $ff ? (a) x ( x ) = $ff ? (x) m ( m ) = $ff ? (m) m ( m ) = $ff ? (m) ??  1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ? (m) ??  imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m (m) ? 1 a (a) ? 1 x (x) ? 1 m (m) ? 1 m (m) ? 1 ??  ? dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a (a) (m) ??  ? imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m (m) + 1 a (a) + 1 x (x) + 1 m (m) + 1 m (m) + 1 ??  ? dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc jump address ????? dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 table 13-6. instruction set summary (sheet 3 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
instruction set instruction set summary MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 113 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc (pc) + n (n = 1, 2, or 3) push (pcl); sp (sp) ? 1 push (pch); sp (sp) ? 1 pc effective address ????? dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a (m) ??  ? imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x (m) ??  ? imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) ??  dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right ?? 0  dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a (x) (a) 0 ??? 0inh42 11 neg opr nega negx neg opr ,x neg ,x negate byte (two ? s complement) m ? (m) = $00 ? (m) a ? (a) = $00 ? (a) x ? (x) = $00 ? (x) m ? (m) = $00 ? (m) m ? (m) = $00 ? (m) ??  dir inh inh ix1 ix 30 40 50 60 70 dd ff 5 3 3 6 5 nop no operation ????? inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a (a) (m) ??  ? imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit ??  dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 table 13-6. instruction set summary (sheet 4 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc c b0 b7 0 b0 b7 c 0 c b0 b7
instruction set advance information MC68HC705P6A ? rev. 2.0 114 instruction set motorola ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit ??  dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp $00ff ????? inh 9c 2 rti return from interrupt sp (sp) + 1; pull (ccr) sp (sp) + 1; pull (a) sp (sp) + 1; pull (x) sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl)  inh 80 9 rts return from subroutine sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl) ????? inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a (a) ? (m) ? (c) ??  imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c 1 ???? 1inh99 2 sei set interrupt mask i 1 ? 1 ??? inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m (a) ??  ? dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin ? 0 ??? inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m (x) ??  ? dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a (a) ? (m) ??  imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc (pc) + 1; push (pcl) sp (sp) ? 1; push (pch) sp (sp) ? 1; push (x) sp (sp) ? 1; push (a) sp (sp) ? 1; push (ccr) sp (sp) ? 1; i 1 pch interrupt vector high byte pcl interrupt vector low byte ? 1 ??? inh 83 10 table 13-6. instruction set summary (sheet 5 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc b0 b7 c
instruction set opcode map MC68HC705P6A ? rev. 2.0 advance information motorola instruction set 115 13.6 opcode map see table 13-7 . tax transfer accumulator to index register x (a) ????? inh 97 2 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ? $00 ??  ? dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a (x) ????? inh 9f 2 wait stop cpu clock and enable interrupts ? 0 ??? inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow flag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry flag z zero flag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ( ) negation (two ? s complement) ix1 indexed, 8-bit offset addressing mode loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative flag  set or cleared n any bit ? not affected table 13-6. instruction set summary (sheet 6 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
advance information MC68HC705P6A ? rev. 2.0 116 instruction set motorola instruction set table 13-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789abcdef 0 5 brset0 3dir 5 bset0 2dir 3 bra 2rel 5 neg 2dir 3 nega 1inh 3 negx 1inh 6 neg 2ix1 5 neg 1ix 9 rti 1inh 2 sub 2imm 3 sub 2dir 4 sub 3ext 5 sub 3ix2 4 sub 2ix1 3 sub 1ix 0 1 5 brclr0 3dir 5 bclr0 2dir 3 brn 2rel 6 rts 1inh 2 cmp 2imm 3 cmp 2dir 4 cmp 3ext 5 cmp 3ix2 4 cmp 2ix1 3 cmp 1ix 1 2 5 brset1 3dir 5 bset1 2dir 3 bhi 2rel 11 mul 1inh 2 sbc 2imm 3 sbc 2dir 4 sbc 3ext 5 sbc 3ix2 4 sbc 2ix1 3 sbc 1ix 2 3 5 brclr1 3dir 5 bclr1 2dir 3 bls 2rel 5 com 2dir 3 coma 1inh 3 comx 1inh 6 com 2ix1 5 com 1ix 10 swi 1inh 2 cpx 2imm 3 cpx 2dir 4 cpx 3ext 5 cpx 3ix2 4 cpx 2ix1 3 cpx 1ix 3 4 5 brset2 3dir 5 bset2 2dir 3 bcc 2rel 5 lsr 2dir 3 lsra 1inh 3 lsrx 1inh 6 lsr 2ix1 5 lsr 1ix 2 and 2imm 3 and 2dir 4 and 3ext 5 and 3ix2 4 and 2ix1 3 and 1ix 4 5 5 brclr2 3dir 5 bclr2 2dir 3 bcs/blo 2rel 2 bit 2imm 3 bit 2dir 4 bit 3ext 5 bit 3ix2 4 bit 2ix1 3 bit 1ix 5 6 5 brset3 3dir 5 bset3 2dir 3 bne 2rel 5 ror 2dir 3 rora 1inh 3 rorx 1inh 6 ror 2ix1 5 ror 1ix 2 lda 2imm 3 lda 2dir 4 lda 3ext 5 lda 3ix2 4 lda 2ix1 3 lda 1ix 6 7 5 brclr3 3dir 5 bclr3 2dir 3 beq 2rel 5 asr 2dir 3 asra 1inh 3 asrx 1inh 6 asr 2ix1 5 asr 1ix 2 tax 1inh 4 sta 2dir 5 sta 3ext 6 sta 3ix2 5 sta 2ix1 4 sta 1ix 7 8 5 brset4 3dir 5 bset4 2dir 3 bhcc 2rel 5 asl/lsl 2dir 3 asla/lsla 1inh 3 aslx/lslx 1inh 6 asl/lsl 2ix1 5 asl/lsl 1ix 2 clc 1inh 2 eor 2imm 3 eor 2dir 4 eor 3ext 5 eor 3ix2 4 eor 2ix1 3 eor 1ix 8 9 5 brclr4 3dir 5 bclr4 2dir 3 bhcs 2rel 5 rol 2dir 3 rola 1inh 3 rolx 1inh 6 rol 2ix1 5 rol 1ix 2 sec 1inh 2 adc 2imm 3 adc 2dir 4 adc 3ext 5 adc 3ix2 4 adc 2ix1 3 adc 1ix 9 a 5 brset5 3dir 5 bset5 2dir 3 bpl 2rel 5 dec 2dir 3 deca 1inh 3 decx 1inh 6 dec 2ix1 5 dec 1ix 2 cli 1inh 2 ora 2imm 3 ora 2dir 4 ora 3ext 5 ora 3ix2 4 ora 2ix1 3 ora 1ix a b 5 brclr5 3dir 5 bclr5 2dir 3 bmi 2rel 2 sei 1inh 2 add 2imm 3 add 2dir 4 add 3ext 5 add 3ix2 4 add 2ix1 3 add 1ix b c 5 brset6 3dir 5 bset6 2dir 3 bmc 2rel 5 inc 2dir 3 inca 1inh 3 incx 1inh 6 inc 2ix1 5 inc 1ix 2 rsp 1inh 2 jmp 2dir 3 jmp 3ext 4 jmp 3ix2 3 jmp 2ix1 2 jmp 1ix c d 5 brclr6 3dir 5 bclr6 2dir 3 bms 2rel 4 tst 2dir 3 tsta 1inh 3 tstx 1inh 5 tst 2ix1 4 tst 1ix 2 nop 1inh 6 bsr 2rel 5 jsr 2dir 6 jsr 3ext 7 jsr 3ix2 6 jsr 2ix1 5 jsr 1ix d e 5 brset7 3dir 5 bset7 2dir 3 bil 2rel 2 stop 1inh 2 ldx 2imm 3 ldx 2dir 4 ldx 3ext 5 ldx 3ix2 4 ldx 2ix1 3 ldx 1ix e f 5 brclr7 3dir 5 bclr7 2dir 3 bih 2rel 5 clr 2dir 3 clra 1inh 3 clrx 1inh 6 clr 2ix1 5 clr 1ix 2 wait 1inh 2 txa 1inh 4 stx 2dir 5 stx 3ext 6 stx 3ix2 5 stx 2ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb
MC68HC705P6A ? rev. 2.0 advance information motorola electrical specifications 117 advance information ? MC68HC705P6A section 14. electrical specifications 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 14.3 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 14.4 operating temperature range. . . . . . . . . . . . . . . . . . . . . . . .118 14.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 14.6 5.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .119 14.7 3.3-volt dc electrical charactertistics . . . . . . . . . . . . . . . . . .120 14.8 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . 121 14.9 eprom programming characteristics . . . . . . . . . . . . . . . . . .122 14.10 siop timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 14.11 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 14.2 introduction this section contains the electrical and timing specifications. 14.3 maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it.
electrical specifications advance information MC68HC705P6A ? rev. 2.0 118 electrical specifications motorola the mcu contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table below. keep v in and v o ut within the range v ss (v in or v o ut ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd . note: this device is not guaranteed to operate properly at the maximum ratings. refer to 14.6 5.0-volt dc electrical characteristics and 14.7 3.3-volt dc electrical charactertistics for guaranteed operating conditions. 14.4 operating temperature range 14.5 thermal characteristics rating (1) 1. voltages are referenced to v ss . symbol value unit supply voltage v dd ? 0.3 to +7.0 v input voltage v in v ss ? 0.3 to v dd +0.3 v bootloader mode (irq /v pp pin only) v in v ss ? 0.3 to 2 x v dd +0.3 v current drain per pin excluding v dd and v ss i25ma storage temperature range t stg ? 65 to +150 c characteristic symbol value unit operating temperature range MC68HC705P6A (standard) MC68HC705P6Ac (extended) t a t l to t h 0 to +70 ? 40 to +85 c characteristic symbol value unit thermal resistance pdip soic ja 60 60 c/w
electrical specifications 5.0-volt dc electrical characteristics MC68HC705P6A ? rev. 2.0 advance information motorola electrical specifications 119 14.6 5.0-volt dc electrical characteristics characteristic (1) symbol min typ (2) max unit output voltage i load = 10.0 a i load = ? 10.0 a v ol v oh ? v dd ? 0.1 ? ? 0.1 ? v output high voltage (i load = ? 0.8 ma) pa0:7, pb5:7, pc2:7, pd5, tcmp (i load = ? 5.0 ma) pc0:1 v oh v dd ? 0.8 v dd ? 0.8 ? ? ? ? v output low voltage (i load = 1.6 ma) pa0:7, pb5:7, pc2:7, pd5, tcmp (i load = 10 ma) pc0:1 v ol ? ? ? ? 0.4 0.4 v input high voltage pa0:7, pb5:7, pc0:7, pd5, tcap/pd7, irq /v pp , reset , osc1 v ih 0.7 x v dd ? v dd v input low voltage pa0:7, pb5:7, pc0:7, pd5, tcap/pd7, irq /v pp , reset , osc1 v il v ss ? 0.2 x v dd v supply current (3), (4) run wait (5) (a/d converter on) wait (5) (a/d converter off) stop (6) 25 c 0 c to +70 c (standard) ? 40 c to +85 c (extended) i dd ? ? ? ? ? ? 4.0 2.0 1.3 2 ? ? 7.0 4.0 2.0 30 50 100 ma ma ma a a a i/o ports high-z leakage current pa0:7, pb5:7, pc0:7, pd5, tcap/pd7 i il ?? 10.0 a a/d ports hi-z leakage current pc3:7 i oz ?? 1.0 a input current reset , irq /v pp , osc1, pd7/tcap i in ?? 1.0 a input pullup current pa0:7 (with pullup enabled) i in 175 385 750 a capaitance ports (as input or output) reset , irq /v pp c out c in ? ? ? ? 12 8 pf 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ? 40 c to +85 c, unless otherwise noted. all values shown refelect pre-silicon estimates. 2. typical values at midpoint of voltage range, 25 c only. 3. run (operating) i dd , wait i dd : to be measured using external square wave clock source (f osc = 4.2 mhz), all inputs 0.2 v from rail; no dc loads, less than 50 pf on all outputs, c l = 20 pf on osc2. 4. wait, stop i dd : all ports configured as inputs, v il = 0.2 v, v ih = v dd ? 0.2 v. 5. wait i dd will be affected linearly by the osc2 capacitance. 6. stop i dd to be measured with osc1 = v ss .
electrical specifications advance information MC68HC705P6A ? rev. 2.0 120 electrical specifications motorola 14.7 3.3-volt dc electrical charactertistics characteristic (1) symbol min typ (2) max unit output voltage i load = 10.0 a i load = ? 10.0 a v ol v oh ? v dd ? 0.1 ? ? 0.1 ? v output high voltage (i load = ? 0.2 ma) pa0:7, pb5:7, pc2:7, pd5, tcmp (i load = ? 1.2 ma) pc0:1 v oh v dd ? 0.3 v dd ? 0.3 ? ? ? ? v output low voltage (i load = 0.4 ma) pa0:7, pb5:7, pc2:7, pd5, tcmp (i load = 2.5 ma) pc0:1 v ol ? ? ? ? 0.3 0.3 v input high voltage pa0:7, pb5:7, pc0:7, pd5, tcap/pd7, irq /v pp , reset , osc1 v ih 0.7 x v dd ? v dd v input low voltage pa0:7, pb5:7, pc0:7, pd5, tcap/pd7, irq /v pp , reset , osc1 v il v ss ? 0.2 x v dd v supply current (3), (4) run wait (5) (a/d converter on) wait (5) (a/d converter off) stop (6) 25 c 0 c to +70 c (standard) ? 40 c to +85 c (extended) i dd ? ? ? ? ? ? 1.8 1.0 0.6 2 ? ? 2.5 1.4 1.0 20 40 50 ma ma ma a a a i/o ports high-z leakage current pa0:7, pb5:7, pc0:7, pd5, tcap/pd7 i il ?? 10.0 a a/d ports hi-z leakage current pc3:7 i oz ?? 1.0 a input current reset , irq /v pp , osc1, pd7/tcap i in ?? 1.0 a input pullup current pa0:7 (with pullup enabled) i in 75 175 350 a capaitance ports (as input or output) reset , irq /v pp c out c in ? ? ? ? 12 8 pf 1. v dd = 3.3 vdc 0.3 vdc, v ss = 0 vdc, t a = ? 40 c to +85 c, unless otherwise noted. all values shown reflect pre-silicon estimates. 2. typical values at midpoint of voltage range, 25 c only. 3. run (operating) i dd , wait i dd : to be measured using external square wave clock source (f osc = 4.2 mhz), all inputs 0.2 v from rail; no dc loads, less than 50 pf on all outputs, c l = 20 pf on osc2. 4. wait, stop i dd : all ports configured as inputs, v il = 0.2 v, v ih = v dd ? 0.2 v. 5. wait i dd will be affected linearly by the osc2 capacitance. 6. stop i dd to be measured with osc1 = v ss .
electrical specifications a/d converter characteristics MC68HC705P6A ? rev. 2.0 advance information motorola electrical specifications 121 14.8 a/d converter characteristics characteristic (1) 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ? 40 c to +85 c, unless otherwise noted. min max unit comments resolution 8 8 bits absolute accuacy (v dd v refh > 4.0) ? 1 1/2 lsb including quanitization conversion range v refh v ss v ss v refh v dd v a/d accuracy may decrease proportionately as v refh is reduced below 4.0 input leakage ad0, ad1, ad2, ad3 v refh ? ? 1 1 a conversion time mcu external oscillator internal rc oscillator ? ? 32 32 t cyc s includes sampling time monotonicity inherent (within total error) zero input reading 00 01 hex v in = 0 v full-scale reading fe ff hex v in = v refh sample time mcu external oscillator internal rc oscillator ? ? 12 12 t cyc s input capacitance ? 12 pf analog input voltage v ss v refh v a/d on current stabilization time ? 100 s t adon a/d ports hi-z leakage current (pc3:7) ? 1 a i oz
electrical specifications advance information MC68HC705P6A ? rev. 2.0 122 electrical specifications motorola 14.9 eprom programming characteristics 14.10 siop timing figure 14-1. siop timing diagram characteristic symbol min typ max unit programming voltage irq /v pp v pp 16.25 16.5 16.75 v programming current irq /v pp i pp ? 5.0 10 ma programming time per byte t epgm 4 ?? ms number characteristic symbol min max unit operating frequency master slave f op(m) f op(s) 0.25 dc 0.25 0.25 f op 1 cycle time master slave t cyc(m) t cyc(s) 4.0 ? 4.0 4.0 t cyc 2sck low time t cyc 932 ? ns 3 sdo data valid time t v ? 200 ns 4 sdo hold time t ho 0 ? ns 5sdi setup time t s 100 ? ns 6 sdi hold time t h 100 ? ns sdi bit 1 ... 6 bit 7 bit 0 sdo bit 0 bit 1 ... 6 bit 7 sck t 6 t 1 t 5 t 3 t 4 t 2
electrical specifications control timing MC68HC705P6A ? rev. 2.0 advance information motorola electrical specifications 123 14.11 control timing characteristic (1) 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ? 40 c to +125 c, unless otherwise noted symbol min max unit frequency of operation crystal option external clock option f osc ? dc 4.2 4.2 mhz internal operating frequency crystal (f osc 2) external clock (f osc 2) f op ? dc 2.1 2.1 mhz cycle time t cyc 476 ? ns crystal oscillator startup time t oxov ? 100 ms stop mode recovery startup time (crystal oscillator) t ilch ? 100 ms reset pulse width t rl 1.5 ? t cyc interrupt pulse width low (edge-triggered) t ilih 125 ? ns interrupt pulse period (2) 2. the minimum period, t ilil , should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc . t ilil note 2 ? t cyc osc1 pulse width t oh , t ol 200 ? ns a/d on current stabilization time t adon q100 s
advance information MC68HC705P6A ? rev. 2.0 124 electrical specifications motorola electrical specifications figure 14-2. power-on reset and external reset timing diagram pch pcl osc1 (2) reset internal processor internal address bus (1) 1ffe 1fff v dd v dd threshold (1-2 v typical) t vddr 4064 t cyc t cyc t rl internal data bus (1) 1ffe 1ffe 1ffe 1ffe new pc 1fff notes: 1. internal timing signal and bus information are not available externally. 2. osc1 line is not meant to represent frequency. it is only used to represent time. 3. the next rising edge of the internal clock following the rising edge of reset initiates the reset sequence. note 3 new new op code pcl pch new pc new pc op code new pc clock (1)
MC68HC705P6A ? rev. 2.0 advance information motorola mechanical specifications 125 advance information ? MC68HC705P6A section 15. mechanical specifications 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 15.3 plastic dual in-line package (case 710) . . . . . . . . . . . . . . . .126 15.4 small outline integrated circuit package (case 751f) . . . . .126 15.2 introduction the MC68HC705P6A is available in either a 28-pin plastic dual in-line (pdip) or a 28-pin small outline integrated circuit (soic) package. to make sure that you have the latest case outline specifications, contact one of the following:  local motorola sales office  world wide web at http://www.motorola.com/semiconductors follow world wide web on-line instructions to retrieve the current mechanical specifications.
mechanical specifications advance information MC68HC705P6A ? rev. 2.0 126 mechanical specifications motorola 15.3 plastic dual in-line package (case 710) 15.4 small outline integrated circuit package (case 751f)     
  
     
 
 
   
           
         
  

  

      
          
                       !"!#! !     $      !       !   !    # !  114 15 28 b a c n k m j d
  f hg l     
 
           
   
         
             
         
     
         !$  $   %
 !    $ ! !!  !      # ! #
 !"!#! ! #      !    # ! #  ! #        "   !  !"!#! !  -a- -b- 114 15 28 -t- c
      ! ! m j -t- k 26x g 28x d 14x p r x 45 f       !  
MC68HC705P6A ? rev. 2.0 advance information motorola ordering information 127 advance information ? MC68HC705P6A section 16. ordering information 16.1 contents 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 16.3 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 16.2 introduction this section contains ordering information for the available package types. 16.3 mc order numbers the following table shows the mc order numbers for the available package types. mc order number operating temperature range MC68HC705P6Acp (1) (extended) 1. p = plastic dual in-line package ? 40 c to 85 c MC68HC705P6Acdw (2) (extended) 2. dw = small outline integrated circuit (soic) package ? 40 c to 85 c
ordering information advance information MC68HC705P6A ? rev. 2.0 128 ordering information motorola
blank
mc 68hc05p6 technical data how to reach us: usa/europe/locations not listed: motorola literature distribution p.o. box 5405 denver, colorado 80217 1-303-675-2140 1-800-441-2447 technical information center: 1-800-521-6274 japan: motorola japan ltd. sps, technical information center 3-20-1, minami-azabu, minato-ku tokyo 106-8573 japan 81-3-3440-3569 asia/pacific: motorola semiconductors h.k. ltd. silicon harbour centre 2 dai king street tai po industrial estate tai po, n.t., hong kong 852-26668334 home page: http://www.motorola.com/semiconductors/ q4/00 rev 1 mc 68 hc 705p6 a / d rev 2


▲Up To Search▲   

 
Price & Availability of MC68HC705P6A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X